/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
/**
 * @author Pavel Dolgov
 */
package org.apache.harmony.awt.nativebridge.linux;


import org.apache.harmony.awt.nativebridge.*;

/**
 * This file is based on X11 header and has been generated by the nativebridge tool.
 *
 *
 */
public class X11 extends BasicLibWrapper {
    static X11 instance;

    public static synchronized X11 getInstance() {
        if (instance == null) {
            instance = new X11();
        }
        return instance;
    }

    private X11() {
        org.apache.harmony.awt.Utils.loadLibrary("X11Wrapper"); //$NON-NLS-1$
        init();
    }

    private static native void init();

    public final XImage XGetSubImage(long param_0, long param_1, int param_2, int param_3, int param_4, int param_5, long param_6, int param_7, XImage param_8, int param_9, int param_10) {
        long tmp_0 = param_8 == null ? 0 : param_8.longLockPointer();
        long tmp_ret = XGetSubImage(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, tmp_0, param_9, param_10);
        if (param_8 != null) {
            param_8.unlock();
        }
        return instance.createXImage(tmp_ret);
    }
    public final native long XGetSubImage(long param_0, long param_1, int param_2, int param_3, int param_4, int param_5, long param_6, int param_7, long param_8, int param_9, int param_10);


    public static class XImage extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 136 : 88;

        XImage(boolean direct) {
            super(sizeof, direct);
        }
        XImage(VoidPointer base) {
            super(base);
        }
        XImage(long addr) {
            super(addr);
        }
        public final void set_width(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_width() {
            return byteBase.getInt32(0);
        }
        public final void set_height(int val) {
            byteBase.setInt32(4, val);
        }
        public final int get_height() {
            return byteBase.getInt32(4);
        }
        public final void set_xoffset(int val) {
            byteBase.setInt32(8, val);
        }
        public final int get_xoffset() {
            return byteBase.getInt32(8);
        }
        public final void set_format(int val) {
            byteBase.setInt32(12, val);
        }
        public final int get_format() {
            return byteBase.getInt32(12);
        }
        public final void set_data(Int8Pointer val) {
            byteBase.setPointer(16, val);
        }
        public final Int8Pointer get_data() {
            return nb.createInt8Pointer(byteBase.getAddress(16));
        }
        public final void set_byte_order(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 24 : 20, val);
        }
        public final int get_byte_order() {
            return byteBase.getInt32(NativeBridge.is64 ? 24 : 20);
        }
        public final void set_bitmap_unit(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 28 : 24, val);
        }
        public final int get_bitmap_unit() {
            return byteBase.getInt32(NativeBridge.is64 ? 28 : 24);
        }
        public final void set_bitmap_bit_order(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 32 : 28, val);
        }
        public final int get_bitmap_bit_order() {
            return byteBase.getInt32(NativeBridge.is64 ? 32 : 28);
        }
        public final void set_bitmap_pad(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 36 : 32, val);
        }
        public final int get_bitmap_pad() {
            return byteBase.getInt32(NativeBridge.is64 ? 36 : 32);
        }
        public final void set_depth(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 36, val);
        }
        public final int get_depth() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 36);
        }
        public final void set_bytes_per_line(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 40, val);
        }
        public final int get_bytes_per_line() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 40);
        }
        public final void set_bits_per_pixel(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 44, val);
        }
        public final int get_bits_per_pixel() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 44);
        }
        public final void set_red_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 48, val);
        }
        public final long get_red_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 48);
        }
        public final void set_green_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 64 : 52, val);
        }
        public final long get_green_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 64 : 52);
        }
        public final void set_blue_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 72 : 56, val);
        }
        public final long get_blue_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 72 : 56);
        }
        public final void set_obdata(Int8Pointer val) {
            byteBase.setPointer(NativeBridge.is64 ? 80 : 60, val);
        }
        public final Int8Pointer get_obdata() {
            return nb.createInt8Pointer(byteBase.getAddress(NativeBridge.is64 ? 80 : 60));
        }
        public final funcs get_f() {
            return instance.createfuncs(getElementPointer(NativeBridge.is64 ? 88 : 64));
        }
        public int size() {
            return sizeof;
        }
    }

    public final XImage createXImage(boolean direct) {
        return new XImage(direct);
    }
    public final XImage createXImage(VoidPointer base) {
        return new XImage(base);
    }
    public final XImage createXImage(long addr) {
        return new XImage(addr);
    }


    public static class funcs extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 48 : 24;

        funcs(boolean direct) {
            super(sizeof, direct);
        }
        funcs(VoidPointer base) {
            super(base);
        }
        funcs(long addr) {
            super(addr);
        }
        public final void set_create_image(long val) {
            byteBase.setAddress(0, val);
        }
        public final long get_create_image() {
            return byteBase.getAddress(0);
        }
        public final X11.XImage create_image(long param_0, Visual param_1, int param_2, int param_3, int param_4, Int8Pointer param_5, int param_6, int param_7, int param_8, int param_9) {
            long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
            long tmp_1 = param_5 == null ? 0 : param_5.longLockPointer();
            long tmp_ret = instance.proxycall0(get_create_image(), param_0, tmp_0, param_2, param_3, param_4, tmp_1, param_6, param_7, param_8, param_9);
            if (param_1 != null) {
                param_1.unlock();
            }
            if (param_5 != null) {
                param_5.unlock();
            }
            return X11.instance.createXImage(tmp_ret);
        }
        public final void set_destroy_image(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_destroy_image() {
            return byteBase.getAddress(NativeBridge.is64 ? 8 : 4);
        }
        public final int destroy_image(X11.XImage param_0) {
            long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
            int tmp_ret = instance.proxycall1(get_destroy_image(), tmp_0);
            if (param_0 != null) {
                param_0.unlock();
            }
            return tmp_ret;
        }
        public final void set_get_pixel(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val);
        }
        public final long get_get_pixel() {
            return byteBase.getAddress(NativeBridge.is64 ? 16 : 8);
        }
        public final long get_pixel(X11.XImage param_0, int param_1, int param_2) {
            long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
            long tmp_ret = instance.proxycall2(get_get_pixel(), tmp_0, param_1, param_2);
            if (param_0 != null) {
                param_0.unlock();
            }
            return tmp_ret;
        }
        public final void set_put_pixel(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_put_pixel() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final int put_pixel(X11.XImage param_0, int param_1, int param_2, long param_3) {
            long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
            int tmp_ret = instance.proxycall3(get_put_pixel(), tmp_0, param_1, param_2, param_3);
            if (param_0 != null) {
                param_0.unlock();
            }
            return tmp_ret;
        }
        public final void set_sub_image(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_sub_image() {
            return byteBase.getAddress(NativeBridge.is64 ? 32 : 16);
        }
        public final X11.XImage sub_image(X11.XImage param_0, int param_1, int param_2, int param_3, int param_4) {
            long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
            long tmp_ret = instance.proxycall4(get_sub_image(), tmp_0, param_1, param_2, param_3, param_4);
            if (param_0 != null) {
                param_0.unlock();
            }
            return X11.instance.createXImage(tmp_ret);
        }
        public final void set_add_pixel(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_add_pixel() {
            return byteBase.getAddress(NativeBridge.is64 ? 40 : 20);
        }
        public final int add_pixel(X11.XImage param_0, long param_1) {
            long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
            int tmp_ret = instance.proxycall5(get_add_pixel(), tmp_0, param_1);
            if (param_0 != null) {
                param_0.unlock();
            }
            return tmp_ret;
        }
        public int size() {
            return sizeof;
        }
    }

    public final funcs createfuncs(boolean direct) {
        return new funcs(direct);
    }
    public final funcs createfuncs(VoidPointer base) {
        return new funcs(base);
    }
    public final funcs createfuncs(long addr) {
        return new funcs(addr);
    }


    public static class Visual extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 32;

        Visual(boolean direct) {
            super(sizeof, direct);
        }
        Visual(VoidPointer base) {
            super(base);
        }
        Visual(long addr) {
            super(addr);
        }
        public final XExtData get_ext_data() {
            return instance.createXExtData(byteBase.getAddress(0));
        }
        public final void set_visualid(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_visualid() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_class(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_class() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_red_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_red_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_green_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_green_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_blue_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_blue_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_bits_per_rgb(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_bits_per_rgb() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_map_entries(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 28, val);
        }
        public final int get_map_entries() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 28);
        }
        public int size() {
            return sizeof;
        }
    }

    public final Visual createVisual(boolean direct) {
        return new Visual(direct);
    }
    public final Visual createVisual(VoidPointer base) {
        return new Visual(base);
    }
    public final Visual createVisual(long addr) {
        return new Visual(addr);
    }


    public static class XExtData extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 32 : 16;

        XExtData(boolean direct) {
            super(sizeof, direct);
        }
        XExtData(VoidPointer base) {
            super(base);
        }
        XExtData(long addr) {
            super(addr);
        }
        public final void set_number(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_number() {
            return byteBase.getInt32(0);
        }
        public final XExtData get_next() {
            return instance.createXExtData(byteBase.getAddress(NativeBridge.is64 ? 8 : 4));
        }
        public final void set_free_private(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 16 : 8, val);
        }
        public final long get_free_private() {
            return byteBase.getAddress(NativeBridge.is64 ? 16 : 8);
        }
        public final int free_private(XExtData extension) {
            long tmp_0 = extension == null ? 0 : extension.longLockPointer();
            int tmp_ret = instance.proxycall6(get_free_private(), tmp_0);
            if (extension != null) {
                extension.unlock();
            }
            return tmp_ret;
        }
        public final void set_private_data(Int8Pointer val) {
            byteBase.setPointer(NativeBridge.is64 ? 24 : 12, val);
        }
        public final Int8Pointer get_private_data() {
            return nb.createInt8Pointer(byteBase.getAddress(NativeBridge.is64 ? 24 : 12));
        }
        public int size() {
            return sizeof;
        }
    }

    public final XExtData createXExtData(boolean direct) {
        return new XExtData(direct);
    }
    public final XExtData createXExtData(VoidPointer base) {
        return new XExtData(base);
    }
    public final XExtData createXExtData(long addr) {
        return new XExtData(addr);
    }

    final native long proxycall0(long fnptr, long param_0, long param_1, int param_2, int param_3, int param_4, long param_5, int param_6, int param_7, int param_8, int param_9);
    final native int proxycall1(long fnptr, long param_0);
    final native long proxycall2(long fnptr, long param_0, int param_1, int param_2);
    final native int proxycall3(long fnptr, long param_0, int param_1, int param_2, long param_3);
    final native long proxycall4(long fnptr, long param_0, int param_1, int param_2, int param_3, int param_4);
    final native int proxycall5(long fnptr, long param_0, long param_1);
    final native int proxycall6(long fnptr, long extension);
    public final int XAllocColor(long param_0, long param_1, XColor param_2) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XAllocColor(param_0, param_1, tmp_0);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XAllocColor(long param_0, long param_1, long param_2);


    public static class XColor extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 16 : 12;

        XColor(boolean direct) {
            super(sizeof, direct);
        }
        XColor(VoidPointer base) {
            super(base);
        }
        XColor(long addr) {
            super(addr);
        }
        public final void set_pixel(long val) {
            byteBase.setCLong(0, val);
        }
        public final long get_pixel() {
            return byteBase.getCLong(0);
        }
        public final void set_red(short val) {
            byteBase.setInt16(NativeBridge.is64 ? 8 : 4, val);
        }
        public final short get_red() {
            return byteBase.getInt16(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_green(short val) {
            byteBase.setInt16(NativeBridge.is64 ? 10 : 6, val);
        }
        public final short get_green() {
            return byteBase.getInt16(NativeBridge.is64 ? 10 : 6);
        }
        public final void set_blue(short val) {
            byteBase.setInt16(NativeBridge.is64 ? 12 : 8, val);
        }
        public final short get_blue() {
            return byteBase.getInt16(NativeBridge.is64 ? 12 : 8);
        }
        public final void set_flags(byte val) {
            byteBase.set(NativeBridge.is64 ? 14 : 10, val);
        }
        public final byte get_flags() {
            return byteBase.get(NativeBridge.is64 ? 14 : 10);
        }
        public final void set_pad(byte val) {
            byteBase.set(NativeBridge.is64 ? 15 : 11, val);
        }
        public final byte get_pad() {
            return byteBase.get(NativeBridge.is64 ? 15 : 11);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XColor createXColor(boolean direct) {
        return new XColor(direct);
    }
    public final XColor createXColor(VoidPointer base) {
        return new XColor(base);
    }
    public final XColor createXColor(long addr) {
        return new XColor(addr);
    }

    public final int XLookupString(XKeyEvent param_0, Int8Pointer param_1, int param_2, CLongPointer param_3, XComposeStatus param_4) {
        long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
        long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer();
        long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_3 = param_4 == null ? 0 : param_4.longLockPointer();
        int tmp_ret = XLookupString(tmp_0, tmp_1, param_2, tmp_2, tmp_3);
        if (param_0 != null) {
            param_0.unlock();
        }
        if (param_1 != null) {
            param_1.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        if (param_4 != null) {
            param_4.unlock();
        }
        return tmp_ret;
    }
    public final native int XLookupString(long param_0, long param_1, int param_2, long param_3, long param_4);


    public static class XKeyEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 96 : 60;

        XKeyEvent(boolean direct) {
            super(sizeof, direct);
        }
        XKeyEvent(VoidPointer base) {
            super(base);
        }
        XKeyEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_root(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_root() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_subwindow(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_subwindow() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_time(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 28, val);
        }
        public final long get_time() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 28);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 32, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 32);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 68 : 36, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 68 : 36);
        }
        public final void set_x_root(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 72 : 40, val);
        }
        public final int get_x_root() {
            return byteBase.getInt32(NativeBridge.is64 ? 72 : 40);
        }
        public final void set_y_root(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 76 : 44, val);
        }
        public final int get_y_root() {
            return byteBase.getInt32(NativeBridge.is64 ? 76 : 44);
        }
        public final void set_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 80 : 48, val);
        }
        public final int get_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 80 : 48);
        }
        public final void set_keycode(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 84 : 52, val);
        }
        public final int get_keycode() {
            return byteBase.getInt32(NativeBridge.is64 ? 84 : 52);
        }
        public final void set_same_screen(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 88 : 56, val);
        }
        public final int get_same_screen() {
            return byteBase.getInt32(NativeBridge.is64 ? 88 : 56);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XKeyEvent createXKeyEvent(boolean direct) {
        return new XKeyEvent(direct);
    }
    public final XKeyEvent createXKeyEvent(VoidPointer base) {
        return new XKeyEvent(base);
    }
    public final XKeyEvent createXKeyEvent(long addr) {
        return new XKeyEvent(addr);
    }


    public static class XComposeStatus extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 16 : 8;

        XComposeStatus(boolean direct) {
            super(sizeof, direct);
        }
        XComposeStatus(VoidPointer base) {
            super(base);
        }
        XComposeStatus(long addr) {
            super(addr);
        }
        public final void set_compose_ptr(Int8Pointer val) {
            byteBase.setPointer(0, val);
        }
        public final Int8Pointer get_compose_ptr() {
            return nb.createInt8Pointer(byteBase.getAddress(0));
        }
        public final void set_chars_matched(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 8 : 4, val);
        }
        public final int get_chars_matched() {
            return byteBase.getInt32(NativeBridge.is64 ? 8 : 4);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XComposeStatus createXComposeStatus(boolean direct) {
        return new XComposeStatus(direct);
    }
    public final XComposeStatus createXComposeStatus(VoidPointer base) {
        return new XComposeStatus(base);
    }
    public final XComposeStatus createXComposeStatus(long addr) {
        return new XComposeStatus(addr);
    }

    public final int XGetWMNormalHints(long param_0, long param_1, XSizeHints param_2, CLongPointer param_3) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XGetWMNormalHints(param_0, param_1, tmp_0, tmp_1);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XGetWMNormalHints(long param_0, long param_1, long param_2, long param_3);


    public static class XSizeHints extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 80 : 72;

        XSizeHints(boolean direct) {
            super(sizeof, direct);
        }
        XSizeHints(VoidPointer base) {
            super(base);
        }
        XSizeHints(long addr) {
            super(addr);
        }
        public final void set_flags(long val) {
            byteBase.setCLong(0, val);
        }
        public final long get_flags() {
            return byteBase.getCLong(0);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 8 : 4, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 12 : 8, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 12 : 8);
        }
        public final void set_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 12, val);
        }
        public final int get_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 12);
        }
        public final void set_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 20 : 16, val);
        }
        public final int get_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 20 : 16);
        }
        public final void set_min_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 24 : 20, val);
        }
        public final int get_min_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 24 : 20);
        }
        public final void set_min_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 28 : 24, val);
        }
        public final int get_min_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 28 : 24);
        }
        public final void set_max_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 32 : 28, val);
        }
        public final int get_max_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 32 : 28);
        }
        public final void set_max_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 36 : 32, val);
        }
        public final int get_max_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 36 : 32);
        }
        public final void set_width_inc(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 36, val);
        }
        public final int get_width_inc() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 36);
        }
        public final void set_height_inc(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 40, val);
        }
        public final int get_height_inc() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 40);
        }
        public final void set_min_aspect_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 44, val);
        }
        public final int get_min_aspect_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 44);
        }
        public final void set_min_aspect_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 48, val);
        }
        public final int get_min_aspect_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 48);
        }
        public final void set_max_aspect_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 52, val);
        }
        public final int get_max_aspect_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 52);
        }
        public final void set_max_aspect_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 60 : 56, val);
        }
        public final int get_max_aspect_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 60 : 56);
        }
        public final void set_base_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 60, val);
        }
        public final int get_base_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 60);
        }
        public final void set_base_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 68 : 64, val);
        }
        public final int get_base_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 68 : 64);
        }
        public final void set_win_gravity(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 72 : 68, val);
        }
        public final int get_win_gravity() {
            return byteBase.getInt32(NativeBridge.is64 ? 72 : 68);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XSizeHints createXSizeHints(boolean direct) {
        return new XSizeHints(direct);
    }
    public final XSizeHints createXSizeHints(VoidPointer base) {
        return new XSizeHints(base);
    }
    public final XSizeHints createXSizeHints(long addr) {
        return new XSizeHints(addr);
    }

    public final long XCreatePixmapCursor(long param_0, long param_1, long param_2, X11.XColor param_3, X11.XColor param_4, int param_5, int param_6) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_1 = param_4 == null ? 0 : param_4.longLockPointer();
        long tmp_ret = XCreatePixmapCursor(param_0, param_1, param_2, tmp_0, tmp_1, param_5, param_6);
        if (param_3 != null) {
            param_3.unlock();
        }
        if (param_4 != null) {
            param_4.unlock();
        }
        return tmp_ret;
    }
    public final native long XCreatePixmapCursor(long param_0, long param_1, long param_2, long param_3, long param_4, int param_5, int param_6);

    public final native int XSetInputFocus(long param_0, long param_1, int param_2, long param_3);

    public final long XOpenDisplay(String param_0) {
        Int8Pointer _param_0 = null == param_0? null :  nb.createInt8Pointer(param_0, false);
        long tmp_0 = _param_0 == null ? 0 : _param_0.longLockPointer();
        long tmp_ret = XOpenDisplay(tmp_0);
        if (_param_0 != null) {
            _param_0.unlock();
            _param_0.free();
        }
        return tmp_ret;
    }
    public final long XOpenDisplay(Int8Pointer param_0) {
        long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
        long tmp_ret = XOpenDisplay(tmp_0);
        if (param_0 != null) {
            param_0.unlock();
        }
        return tmp_ret;
    }
    public final native long XOpenDisplay(long param_0);

    public final native int XGrabServer(long param_0);

    public final native long XCreateFontCursor(long param_0, int param_1);

    public final X11.XImage XCreateImage(long param_0, X11.Visual param_1, int param_2, int param_3, int param_4, Int8Pointer param_5, int param_6, int param_7, int param_8, int param_9) {
        long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
        long tmp_1 = param_5 == null ? 0 : param_5.longLockPointer();
        long tmp_ret = XCreateImage(param_0, tmp_0, param_2, param_3, param_4, tmp_1, param_6, param_7, param_8, param_9);
        if (param_1 != null) {
            param_1.unlock();
        }
        if (param_5 != null) {
            param_5.unlock();
        }
        return X11.instance.createXImage(tmp_ret);
    }
    public final native long XCreateImage(long param_0, long param_1, int param_2, int param_3, int param_4, long param_5, int param_6, int param_7, int param_8, int param_9);

    public final int XRestackWindows(long param_0, CLongPointer param_1, int param_2) {
        long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
        int tmp_ret = XRestackWindows(param_0, tmp_0, param_2);
        if (param_1 != null) {
            param_1.unlock();
        }
        return tmp_ret;
    }
    public final native int XRestackWindows(long param_0, long param_1, int param_2);

    public final native int XDefaultDepth(long param_0, int param_1);

    public final int XFree(VoidPointer param_0) {
        long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
        int tmp_ret = XFree(tmp_0);
        if (param_0 != null) {
            param_0.unlock();
        }
        return tmp_ret;
    }
    public final native int XFree(long param_0);

    public final native int XMoveWindow(long param_0, long param_1, int param_2, int param_3);

    public final native int XScreenCount(long param_0);

    public final native long XDefaultRootWindow(long param_0);

    public final native int XResizeWindow(long param_0, long param_1, int param_2, int param_3);

    public final int XFillPolygon(long param_0, long param_1, long param_2, XPoint param_3, int param_4, int param_5, int param_6) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XFillPolygon(param_0, param_1, param_2, tmp_0, param_4, param_5, param_6);
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XFillPolygon(long param_0, long param_1, long param_2, long param_3, int param_4, int param_5, int param_6);


    public static class XPoint extends CommonStructWrapper {

        public static final int sizeof = 4;

        XPoint(boolean direct) {
            super(sizeof, direct);
        }
        XPoint(VoidPointer base) {
            super(base);
        }
        XPoint(long addr) {
            super(addr);
        }
        public final void set_x(short val) {
            byteBase.setInt16(0, val);
        }
        public final short get_x() {
            return byteBase.getInt16(0);
        }
        public final void set_y(short val) {
            byteBase.setInt16(2, val);
        }
        public final short get_y() {
            return byteBase.getInt16(2);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XPoint createXPoint(boolean direct) {
        return new XPoint(direct);
    }
    public final XPoint createXPoint(VoidPointer base) {
        return new XPoint(base);
    }
    public final XPoint createXPoint(long addr) {
        return new XPoint(addr);
    }

    public final native int XTestFakeMotionEvent(long param_0, int param_1, int param_2, int param_3, long param_4);

    public final long XCreateGC(long param_0, long param_1, long param_2, XGCValues param_3) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_ret = XCreateGC(param_0, param_1, param_2, tmp_0);
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native long XCreateGC(long param_0, long param_1, long param_2, long param_3);


    public static class XGCValues extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 128 : 92;

        XGCValues(boolean direct) {
            super(sizeof, direct);
        }
        XGCValues(VoidPointer base) {
            super(base);
        }
        XGCValues(long addr) {
            super(addr);
        }
        public final void set_function(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_function() {
            return byteBase.getInt32(0);
        }
        public final void set_plane_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_plane_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_foreground(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 16 : 8, val);
        }
        public final long get_foreground() {
            return byteBase.getCLong(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_background(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_background() {
            return byteBase.getCLong(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_line_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 32 : 16, val);
        }
        public final int get_line_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_line_style(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 36 : 20, val);
        }
        public final int get_line_style() {
            return byteBase.getInt32(NativeBridge.is64 ? 36 : 20);
        }
        public final void set_cap_style(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 24, val);
        }
        public final int get_cap_style() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 24);
        }
        public final void set_join_style(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 28, val);
        }
        public final int get_join_style() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 28);
        }
        public final void set_fill_style(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 32, val);
        }
        public final int get_fill_style() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 32);
        }
        public final void set_fill_rule(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 36, val);
        }
        public final int get_fill_rule() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 36);
        }
        public final void set_arc_mode(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 40, val);
        }
        public final int get_arc_mode() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 40);
        }
        public final void set_tile(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 64 : 44, val);
        }
        public final long get_tile() {
            return byteBase.getCLong(NativeBridge.is64 ? 64 : 44);
        }
        public final void set_stipple(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 72 : 48, val);
        }
        public final long get_stipple() {
            return byteBase.getCLong(NativeBridge.is64 ? 72 : 48);
        }
        public final void set_ts_x_origin(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 80 : 52, val);
        }
        public final int get_ts_x_origin() {
            return byteBase.getInt32(NativeBridge.is64 ? 80 : 52);
        }
        public final void set_ts_y_origin(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 84 : 56, val);
        }
        public final int get_ts_y_origin() {
            return byteBase.getInt32(NativeBridge.is64 ? 84 : 56);
        }
        public final void set_font(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 88 : 60, val);
        }
        public final long get_font() {
            return byteBase.getCLong(NativeBridge.is64 ? 88 : 60);
        }
        public final void set_subwindow_mode(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 96 : 64, val);
        }
        public final int get_subwindow_mode() {
            return byteBase.getInt32(NativeBridge.is64 ? 96 : 64);
        }
        public final void set_graphics_exposures(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 100 : 68, val);
        }
        public final int get_graphics_exposures() {
            return byteBase.getInt32(NativeBridge.is64 ? 100 : 68);
        }
        public final void set_clip_x_origin(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 104 : 72, val);
        }
        public final int get_clip_x_origin() {
            return byteBase.getInt32(NativeBridge.is64 ? 104 : 72);
        }
        public final void set_clip_y_origin(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 108 : 76, val);
        }
        public final int get_clip_y_origin() {
            return byteBase.getInt32(NativeBridge.is64 ? 108 : 76);
        }
        public final void set_clip_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 112 : 80, val);
        }
        public final long get_clip_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 112 : 80);
        }
        public final void set_dash_offset(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 120 : 84, val);
        }
        public final int get_dash_offset() {
            return byteBase.getInt32(NativeBridge.is64 ? 120 : 84);
        }
        public final void set_dashes(byte val) {
            byteBase.set(NativeBridge.is64 ? 124 : 88, val);
        }
        public final byte get_dashes() {
            return byteBase.get(NativeBridge.is64 ? 124 : 88);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XGCValues createXGCValues(boolean direct) {
        return new XGCValues(direct);
    }
    public final XGCValues createXGCValues(VoidPointer base) {
        return new XGCValues(base);
    }
    public final XGCValues createXGCValues(long addr) {
        return new XGCValues(addr);
    }

    public final native int XTestFakeKeyEvent(long param_0, int param_1, int param_2, long param_3);

    public final native int XCopyArea(long param_0, long param_1, long param_2, long param_3, int param_4, int param_5, int param_6, int param_7, int param_8, int param_9);

    public final native long XKeycodeToKeysym(long param_0, int param_1, int param_2);

    public final native int XImageByteOrder(long param_0);

    public final native int XDefaultScreen(long param_0);

    public final native int XConvertSelection(long param_0, long param_1, long param_2, long param_3, long param_4, long param_5);

    public final native long XGetSelectionOwner(long param_0, long param_1);

    public final int XFillRectangles(long param_0, long param_1, long param_2, XRectangle param_3, int param_4) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XFillRectangles(param_0, param_1, param_2, tmp_0, param_4);
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XFillRectangles(long param_0, long param_1, long param_2, long param_3, int param_4);


    public static class XRectangle extends CommonStructWrapper {

        public static final int sizeof = 8;

        XRectangle(boolean direct) {
            super(sizeof, direct);
        }
        XRectangle(VoidPointer base) {
            super(base);
        }
        XRectangle(long addr) {
            super(addr);
        }
        public final void set_x(short val) {
            byteBase.setInt16(0, val);
        }
        public final short get_x() {
            return byteBase.getInt16(0);
        }
        public final void set_y(short val) {
            byteBase.setInt16(2, val);
        }
        public final short get_y() {
            return byteBase.getInt16(2);
        }
        public final void set_width(short val) {
            byteBase.setInt16(4, val);
        }
        public final short get_width() {
            return byteBase.getInt16(4);
        }
        public final void set_height(short val) {
            byteBase.setInt16(6, val);
        }
        public final short get_height() {
            return byteBase.getInt16(6);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XRectangle createXRectangle(boolean direct) {
        return new XRectangle(direct);
    }
    public final XRectangle createXRectangle(VoidPointer base) {
        return new XRectangle(base);
    }
    public final XRectangle createXRectangle(long addr) {
        return new XRectangle(addr);
    }

    public final int XSetIconName(long param_0, long param_1, String param_2) {
        Int8Pointer _param_2 = null == param_2? null :  nb.createInt8Pointer(param_2, false);
        long tmp_0 = _param_2 == null ? 0 : _param_2.longLockPointer();
        int tmp_ret = XSetIconName(param_0, param_1, tmp_0);
        if (_param_2 != null) {
            _param_2.unlock();
            _param_2.free();
        }
        return tmp_ret;
    }
    public final int XSetIconName(long param_0, long param_1, Int8Pointer param_2) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XSetIconName(param_0, param_1, tmp_0);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XSetIconName(long param_0, long param_1, long param_2);

    public final native int XDisplayWidthMM(long param_0, int param_1);

    public final native int XMapWindow(long param_0, long param_1);

    public final int XParseColor(long param_0, long param_1, String param_2, X11.XColor param_3) {
        Int8Pointer _param_2 = null == param_2? null :  nb.createInt8Pointer(param_2, false);
        long tmp_0 = _param_2 == null ? 0 : _param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XParseColor(param_0, param_1, tmp_0, tmp_1);
        if (_param_2 != null) {
            _param_2.unlock();
            _param_2.free();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final int XParseColor(long param_0, long param_1, Int8Pointer param_2, X11.XColor param_3) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XParseColor(param_0, param_1, tmp_0, tmp_1);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XParseColor(long param_0, long param_1, long param_2, long param_3);

    public final native int XTestFakeButtonEvent(long param_0, int param_1, int param_2, long param_3);

    public final int XGetWindowProperty(long param_0, long param_1, long param_2, long param_3, long param_4, int param_5, long param_6, CLongPointer param_7, Int32Pointer param_8, CLongPointer param_9, CLongPointer param_10, PointerPointer param_11) {
        long tmp_0 = param_7 == null ? 0 : param_7.longLockPointer();
        long tmp_1 = param_8 == null ? 0 : param_8.longLockPointer();
        long tmp_2 = param_9 == null ? 0 : param_9.longLockPointer();
        long tmp_3 = param_10 == null ? 0 : param_10.longLockPointer();
        long tmp_4 = param_11 == null ? 0 : param_11.longLockPointer();
        int tmp_ret = XGetWindowProperty(param_0, param_1, param_2, param_3, param_4, param_5, param_6, tmp_0, tmp_1, tmp_2, tmp_3, tmp_4);
        if (param_7 != null) {
            param_7.unlock();
        }
        if (param_8 != null) {
            param_8.unlock();
        }
        if (param_9 != null) {
            param_9.unlock();
        }
        if (param_10 != null) {
            param_10.unlock();
        }
        if (param_11 != null) {
            param_11.unlock();
        }
        return tmp_ret;
    }
    public final native int XGetWindowProperty(long param_0, long param_1, long param_2, long param_3, long param_4, int param_5, long param_6, long param_7, long param_8, long param_9, long param_10, long param_11);

    public final native int XIconifyWindow(long param_0, long param_1, int param_2);

    public final native long XAllocWMHints();


    public static class XWMHints extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 36;

        XWMHints(boolean direct) {
            super(sizeof, direct);
        }
        XWMHints(VoidPointer base) {
            super(base);
        }
        XWMHints(long addr) {
            super(addr);
        }
        public final void set_flags(long val) {
            byteBase.setCLong(0, val);
        }
        public final long get_flags() {
            return byteBase.getCLong(0);
        }
        public final void set_input(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 8 : 4, val);
        }
        public final int get_input() {
            return byteBase.getInt32(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_initial_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 12 : 8, val);
        }
        public final int get_initial_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 12 : 8);
        }
        public final void set_icon_pixmap(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 16 : 12, val);
        }
        public final long get_icon_pixmap() {
            return byteBase.getCLong(NativeBridge.is64 ? 16 : 12);
        }
        public final void set_icon_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 24 : 16, val);
        }
        public final long get_icon_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 24 : 16);
        }
        public final void set_icon_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 32 : 20, val);
        }
        public final int get_icon_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 32 : 20);
        }
        public final void set_icon_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 36 : 24, val);
        }
        public final int get_icon_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 36 : 24);
        }
        public final void set_icon_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 28, val);
        }
        public final long get_icon_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 28);
        }
        public final void set_window_group(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 32, val);
        }
        public final long get_window_group() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 32);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XWMHints createXWMHints(boolean direct) {
        return new XWMHints(direct);
    }
    public final XWMHints createXWMHints(VoidPointer base) {
        return new XWMHints(base);
    }
    public final XWMHints createXWMHints(long addr) {
        return new XWMHints(addr);
    }

    public final int XGetRGBColormaps(long param_0, long param_1, PointerPointer param_2, Int32Pointer param_3, long param_4) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XGetRGBColormaps(param_0, param_1, tmp_0, tmp_1, param_4);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XGetRGBColormaps(long param_0, long param_1, long param_2, long param_3, long param_4);

    public final XVisualInfo XGetVisualInfo(long param_0, long param_1, XVisualInfo param_2, Int32Pointer param_3) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_ret = XGetVisualInfo(param_0, param_1, tmp_0, tmp_1);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        return instance.createXVisualInfo(tmp_ret);
    }
    public final native long XGetVisualInfo(long param_0, long param_1, long param_2, long param_3);


    public static class XVisualInfo extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 64 : 40;

        XVisualInfo(boolean direct) {
            super(sizeof, direct);
        }
        XVisualInfo(VoidPointer base) {
            super(base);
        }
        XVisualInfo(long addr) {
            super(addr);
        }
        public final X11.Visual get_visual() {
            return X11.instance.createVisual(byteBase.getAddress(0));
        }
        public final void set_visualid(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_visualid() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_screen(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_screen() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_depth(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 20 : 12, val);
        }
        public final int get_depth() {
            return byteBase.getInt32(NativeBridge.is64 ? 20 : 12);
        }
        public final void set_class(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 24 : 16, val);
        }
        public final int get_class() {
            return byteBase.getInt32(NativeBridge.is64 ? 24 : 16);
        }
        public final void set_red_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 20, val);
        }
        public final long get_red_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 20);
        }
        public final void set_green_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 24, val);
        }
        public final long get_green_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 24);
        }
        public final void set_blue_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 28, val);
        }
        public final long get_blue_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 28);
        }
        public final void set_colormap_size(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 32, val);
        }
        public final int get_colormap_size() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 32);
        }
        public final void set_bits_per_rgb(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 60 : 36, val);
        }
        public final int get_bits_per_rgb() {
            return byteBase.getInt32(NativeBridge.is64 ? 60 : 36);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XVisualInfo createXVisualInfo(boolean direct) {
        return new XVisualInfo(direct);
    }
    public final XVisualInfo createXVisualInfo(VoidPointer base) {
        return new XVisualInfo(base);
    }
    public final XVisualInfo createXVisualInfo(long addr) {
        return new XVisualInfo(addr);
    }

    public final native int XSetFunction(long param_0, long param_1, int param_2);

    public final native int XDestroyWindow(long param_0, long param_1);

    public final native long XRootWindow(long param_0, int param_1);

    public final native int XLowerWindow(long param_0, long param_1);

    public final native long XGetAtomName(long param_0, long param_1);

    public final native int XSelectInput(long param_0, long param_1, long param_2);

    public final native long XGetImage(long param_0, long param_1, int param_2, int param_3, int param_4, int param_5, long param_6, int param_7);

    public final native int XDrawRectangle(long param_0, long param_1, long param_2, int param_3, int param_4, int param_5, int param_6);

    public final native int XUngrabPointer(long param_0, long param_1);

    public final native int XSetForeground(long param_0, long param_1, long param_2);

    public final native int XMapRaised(long param_0, long param_1);

    public final native long XAllPlanes();

    public final native byte XKeysymToKeycode(long param_0, long param_1);

    public final int XQueryPointer(long param_0, long param_1, CLongPointer param_2, CLongPointer param_3, Int32Pointer param_4, Int32Pointer param_5, Int32Pointer param_6, Int32Pointer param_7, Int32Pointer param_8) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
        long tmp_3 = param_5 == null ? 0 : param_5.longLockPointer();
        long tmp_4 = param_6 == null ? 0 : param_6.longLockPointer();
        long tmp_5 = param_7 == null ? 0 : param_7.longLockPointer();
        long tmp_6 = param_8 == null ? 0 : param_8.longLockPointer();
        int tmp_ret = XQueryPointer(param_0, param_1, tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, tmp_5, tmp_6);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        if (param_4 != null) {
            param_4.unlock();
        }
        if (param_5 != null) {
            param_5.unlock();
        }
        if (param_6 != null) {
            param_6.unlock();
        }
        if (param_7 != null) {
            param_7.unlock();
        }
        if (param_8 != null) {
            param_8.unlock();
        }
        return tmp_ret;
    }
    public final native int XQueryPointer(long param_0, long param_1, long param_2, long param_3, long param_4, long param_5, long param_6, long param_7, long param_8);

    public final native int XDisplayWidth(long param_0, int param_1);

    public final native int XDisplayHeightMM(long param_0, int param_1);

    public final int XChangeProperty(long param_0, long param_1, long param_2, long param_3, int param_4, int param_5, String param_6, int param_7) {
        Int8Pointer _param_6 = null == param_6? null :  nb.createInt8Pointer(param_6, false);
        long tmp_0 = _param_6 == null ? 0 : _param_6.longLockPointer();
        int tmp_ret = XChangeProperty(param_0, param_1, param_2, param_3, param_4, param_5, tmp_0, param_7);
        if (_param_6 != null) {
            _param_6.unlock();
            _param_6.free();
        }
        return tmp_ret;
    }
    public final int XChangeProperty(long param_0, long param_1, long param_2, long param_3, int param_4, int param_5, Int8Pointer param_6, int param_7) {
        long tmp_0 = param_6 == null ? 0 : param_6.longLockPointer();
        int tmp_ret = XChangeProperty(param_0, param_1, param_2, param_3, param_4, param_5, tmp_0, param_7);
        if (param_6 != null) {
            param_6.unlock();
        }
        return tmp_ret;
    }
    public final native int XChangeProperty(long param_0, long param_1, long param_2, long param_3, int param_4, int param_5, long param_6, int param_7);

    public final int XCheckTypedEvent(long param_0, int param_1, XEvent param_2) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XCheckTypedEvent(param_0, param_1, tmp_0);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XCheckTypedEvent(long param_0, int param_1, long param_2);


    public static class XEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 192 : 96;

        XEvent(boolean direct) {
            super(sizeof, direct);
        }
        XEvent(VoidPointer base) {
            super(base);
        }
        XEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final XAnyEvent get_xany() {
            return instance.createXAnyEvent(getElementPointer(0));
        }
        public final X11.XKeyEvent get_xkey() {
            return X11.instance.createXKeyEvent(getElementPointer(0));
        }
        public final XButtonEvent get_xbutton() {
            return instance.createXButtonEvent(getElementPointer(0));
        }
        public final XMotionEvent get_xmotion() {
            return instance.createXMotionEvent(getElementPointer(0));
        }
        public final XCrossingEvent get_xcrossing() {
            return instance.createXCrossingEvent(getElementPointer(0));
        }
        public final XFocusChangeEvent get_xfocus() {
            return instance.createXFocusChangeEvent(getElementPointer(0));
        }
        public final XExposeEvent get_xexpose() {
            return instance.createXExposeEvent(getElementPointer(0));
        }
        public final XGraphicsExposeEvent get_xgraphicsexpose() {
            return instance.createXGraphicsExposeEvent(getElementPointer(0));
        }
        public final XNoExposeEvent get_xnoexpose() {
            return instance.createXNoExposeEvent(getElementPointer(0));
        }
        public final XVisibilityEvent get_xvisibility() {
            return instance.createXVisibilityEvent(getElementPointer(0));
        }
        public final XCreateWindowEvent get_xcreatewindow() {
            return instance.createXCreateWindowEvent(getElementPointer(0));
        }
        public final XDestroyWindowEvent get_xdestroywindow() {
            return instance.createXDestroyWindowEvent(getElementPointer(0));
        }
        public final XUnmapEvent get_xunmap() {
            return instance.createXUnmapEvent(getElementPointer(0));
        }
        public final XMapEvent get_xmap() {
            return instance.createXMapEvent(getElementPointer(0));
        }
        public final XMapRequestEvent get_xmaprequest() {
            return instance.createXMapRequestEvent(getElementPointer(0));
        }
        public final XReparentEvent get_xreparent() {
            return instance.createXReparentEvent(getElementPointer(0));
        }
        public final XConfigureEvent get_xconfigure() {
            return instance.createXConfigureEvent(getElementPointer(0));
        }
        public final XGravityEvent get_xgravity() {
            return instance.createXGravityEvent(getElementPointer(0));
        }
        public final XResizeRequestEvent get_xresizerequest() {
            return instance.createXResizeRequestEvent(getElementPointer(0));
        }
        public final XConfigureRequestEvent get_xconfigurerequest() {
            return instance.createXConfigureRequestEvent(getElementPointer(0));
        }
        public final XCirculateEvent get_xcirculate() {
            return instance.createXCirculateEvent(getElementPointer(0));
        }
        public final XCirculateRequestEvent get_xcirculaterequest() {
            return instance.createXCirculateRequestEvent(getElementPointer(0));
        }
        public final XPropertyEvent get_xproperty() {
            return instance.createXPropertyEvent(getElementPointer(0));
        }
        public final XSelectionClearEvent get_xselectionclear() {
            return instance.createXSelectionClearEvent(getElementPointer(0));
        }
        public final XSelectionRequestEvent get_xselectionrequest() {
            return instance.createXSelectionRequestEvent(getElementPointer(0));
        }
        public final XSelectionEvent get_xselection() {
            return instance.createXSelectionEvent(getElementPointer(0));
        }
        public final XColormapEvent get_xcolormap() {
            return instance.createXColormapEvent(getElementPointer(0));
        }
        public final XClientMessageEvent get_xclient() {
            return instance.createXClientMessageEvent(getElementPointer(0));
        }
        public final XMappingEvent get_xmapping() {
            return instance.createXMappingEvent(getElementPointer(0));
        }
        public final XErrorEvent get_xerror() {
            return instance.createXErrorEvent(getElementPointer(0));
        }
        public final XKeymapEvent get_xkeymap() {
            return instance.createXKeymapEvent(getElementPointer(0));
        }
        public final CLongPointer get_pad() {
            return nb.createCLongPointer(getElementPointer(0));
        }
        public int size() {
            return sizeof;
        }
    }

    public final XEvent createXEvent(boolean direct) {
        return new XEvent(direct);
    }
    public final XEvent createXEvent(VoidPointer base) {
        return new XEvent(base);
    }
    public final XEvent createXEvent(long addr) {
        return new XEvent(addr);
    }


    public static class XSelectionEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 72 : 36;

        XSelectionEvent(boolean direct) {
            super(sizeof, direct);
        }
        XSelectionEvent(VoidPointer base) {
            super(base);
        }
        XSelectionEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_requestor(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_requestor() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_selection(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_selection() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_target(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_target() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_property(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 28, val);
        }
        public final long get_property() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 28);
        }
        public final void set_time(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 64 : 32, val);
        }
        public final long get_time() {
            return byteBase.getCLong(NativeBridge.is64 ? 64 : 32);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XSelectionEvent createXSelectionEvent(boolean direct) {
        return new XSelectionEvent(direct);
    }
    public final XSelectionEvent createXSelectionEvent(VoidPointer base) {
        return new XSelectionEvent(base);
    }
    public final XSelectionEvent createXSelectionEvent(long addr) {
        return new XSelectionEvent(addr);
    }


    public static class XResizeRequestEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 48 : 28;

        XResizeRequestEvent(boolean direct) {
            super(sizeof, direct);
        }
        XResizeRequestEvent(VoidPointer base) {
            super(base);
        }
        XResizeRequestEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 20, val);
        }
        public final int get_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 24, val);
        }
        public final int get_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 24);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XResizeRequestEvent createXResizeRequestEvent(boolean direct) {
        return new XResizeRequestEvent(direct);
    }
    public final XResizeRequestEvent createXResizeRequestEvent(VoidPointer base) {
        return new XResizeRequestEvent(base);
    }
    public final XResizeRequestEvent createXResizeRequestEvent(long addr) {
        return new XResizeRequestEvent(addr);
    }


    public static class XUnmapEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 28;

        XUnmapEvent(boolean direct) {
            super(sizeof, direct);
        }
        XUnmapEvent(VoidPointer base) {
            super(base);
        }
        XUnmapEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_event(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_event() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_from_configure(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_from_configure() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XUnmapEvent createXUnmapEvent(boolean direct) {
        return new XUnmapEvent(direct);
    }
    public final XUnmapEvent createXUnmapEvent(VoidPointer base) {
        return new XUnmapEvent(base);
    }
    public final XUnmapEvent createXUnmapEvent(long addr) {
        return new XUnmapEvent(addr);
    }


    public static class XCreateWindowEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 72 : 48;

        XCreateWindowEvent(boolean direct) {
            super(sizeof, direct);
        }
        XCreateWindowEvent(VoidPointer base) {
            super(base);
        }
        XCreateWindowEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_parent(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_parent() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 28, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 28);
        }
        public final void set_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 32, val);
        }
        public final int get_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 32);
        }
        public final void set_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 60 : 36, val);
        }
        public final int get_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 60 : 36);
        }
        public final void set_border_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 40, val);
        }
        public final int get_border_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 40);
        }
        public final void set_override_redirect(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 68 : 44, val);
        }
        public final int get_override_redirect() {
            return byteBase.getInt32(NativeBridge.is64 ? 68 : 44);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XCreateWindowEvent createXCreateWindowEvent(boolean direct) {
        return new XCreateWindowEvent(direct);
    }
    public final XCreateWindowEvent createXCreateWindowEvent(VoidPointer base) {
        return new XCreateWindowEvent(base);
    }
    public final XCreateWindowEvent createXCreateWindowEvent(long addr) {
        return new XCreateWindowEvent(addr);
    }


    public static class XExposeEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 64 : 40;

        XExposeEvent(boolean direct) {
            super(sizeof, direct);
        }
        XExposeEvent(VoidPointer base) {
            super(base);
        }
        XExposeEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 20, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 24, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 24);
        }
        public final void set_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 28, val);
        }
        public final int get_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 28);
        }
        public final void set_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 32, val);
        }
        public final int get_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 32);
        }
        public final void set_count(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 36, val);
        }
        public final int get_count() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 36);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XExposeEvent createXExposeEvent(boolean direct) {
        return new XExposeEvent(direct);
    }
    public final XExposeEvent createXExposeEvent(VoidPointer base) {
        return new XExposeEvent(base);
    }
    public final XExposeEvent createXExposeEvent(long addr) {
        return new XExposeEvent(addr);
    }


    public static class XVisibilityEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 48 : 24;

        XVisibilityEvent(boolean direct) {
            super(sizeof, direct);
        }
        XVisibilityEvent(VoidPointer base) {
            super(base);
        }
        XVisibilityEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 20, val);
        }
        public final int get_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 20);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XVisibilityEvent createXVisibilityEvent(boolean direct) {
        return new XVisibilityEvent(direct);
    }
    public final XVisibilityEvent createXVisibilityEvent(VoidPointer base) {
        return new XVisibilityEvent(base);
    }
    public final XVisibilityEvent createXVisibilityEvent(long addr) {
        return new XVisibilityEvent(addr);
    }


    public static class XMappingEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 32;

        XMappingEvent(boolean direct) {
            super(sizeof, direct);
        }
        XMappingEvent(VoidPointer base) {
            super(base);
        }
        XMappingEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_request(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 20, val);
        }
        public final int get_request() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_first_keycode(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 24, val);
        }
        public final int get_first_keycode() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 24);
        }
        public final void set_count(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 28, val);
        }
        public final int get_count() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 28);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XMappingEvent createXMappingEvent(boolean direct) {
        return new XMappingEvent(direct);
    }
    public final XMappingEvent createXMappingEvent(VoidPointer base) {
        return new XMappingEvent(base);
    }
    public final XMappingEvent createXMappingEvent(long addr) {
        return new XMappingEvent(addr);
    }


    public static class XFocusChangeEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 48 : 28;

        XFocusChangeEvent(boolean direct) {
            super(sizeof, direct);
        }
        XFocusChangeEvent(VoidPointer base) {
            super(base);
        }
        XFocusChangeEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_mode(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 20, val);
        }
        public final int get_mode() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_detail(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 24, val);
        }
        public final int get_detail() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 24);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XFocusChangeEvent createXFocusChangeEvent(boolean direct) {
        return new XFocusChangeEvent(direct);
    }
    public final XFocusChangeEvent createXFocusChangeEvent(VoidPointer base) {
        return new XFocusChangeEvent(base);
    }
    public final XFocusChangeEvent createXFocusChangeEvent(long addr) {
        return new XFocusChangeEvent(addr);
    }


    public static class XCirculateRequestEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 28;

        XCirculateRequestEvent(boolean direct) {
            super(sizeof, direct);
        }
        XCirculateRequestEvent(VoidPointer base) {
            super(base);
        }
        XCirculateRequestEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_parent(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_parent() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_place(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_place() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XCirculateRequestEvent createXCirculateRequestEvent(boolean direct) {
        return new XCirculateRequestEvent(direct);
    }
    public final XCirculateRequestEvent createXCirculateRequestEvent(VoidPointer base) {
        return new XCirculateRequestEvent(base);
    }
    public final XCirculateRequestEvent createXCirculateRequestEvent(long addr) {
        return new XCirculateRequestEvent(addr);
    }


    public static class XNoExposeEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 48 : 28;

        XNoExposeEvent(boolean direct) {
            super(sizeof, direct);
        }
        XNoExposeEvent(VoidPointer base) {
            super(base);
        }
        XNoExposeEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_drawable(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_drawable() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_major_code(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 20, val);
        }
        public final int get_major_code() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_minor_code(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 24, val);
        }
        public final int get_minor_code() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 24);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XNoExposeEvent createXNoExposeEvent(boolean direct) {
        return new XNoExposeEvent(direct);
    }
    public final XNoExposeEvent createXNoExposeEvent(VoidPointer base) {
        return new XNoExposeEvent(base);
    }
    public final XNoExposeEvent createXNoExposeEvent(long addr) {
        return new XNoExposeEvent(addr);
    }


    public static class XColormapEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 32;

        XColormapEvent(boolean direct) {
            super(sizeof, direct);
        }
        XColormapEvent(VoidPointer base) {
            super(base);
        }
        XColormapEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_colormap(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_colormap() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_new(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_new() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 28, val);
        }
        public final int get_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 28);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XColormapEvent createXColormapEvent(boolean direct) {
        return new XColormapEvent(direct);
    }
    public final XColormapEvent createXColormapEvent(VoidPointer base) {
        return new XColormapEvent(base);
    }
    public final XColormapEvent createXColormapEvent(long addr) {
        return new XColormapEvent(addr);
    }


    public static class XSelectionRequestEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 80 : 40;

        XSelectionRequestEvent(boolean direct) {
            super(sizeof, direct);
        }
        XSelectionRequestEvent(VoidPointer base) {
            super(base);
        }
        XSelectionRequestEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_owner(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_owner() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_requestor(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_requestor() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_selection(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_selection() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_target(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 28, val);
        }
        public final long get_target() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 28);
        }
        public final void set_property(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 64 : 32, val);
        }
        public final long get_property() {
            return byteBase.getCLong(NativeBridge.is64 ? 64 : 32);
        }
        public final void set_time(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 72 : 36, val);
        }
        public final long get_time() {
            return byteBase.getCLong(NativeBridge.is64 ? 72 : 36);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XSelectionRequestEvent createXSelectionRequestEvent(boolean direct) {
        return new XSelectionRequestEvent(direct);
    }
    public final XSelectionRequestEvent createXSelectionRequestEvent(VoidPointer base) {
        return new XSelectionRequestEvent(base);
    }
    public final XSelectionRequestEvent createXSelectionRequestEvent(long addr) {
        return new XSelectionRequestEvent(addr);
    }


    public static class XErrorEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 40 : 20;

        XErrorEvent(boolean direct) {
            super(sizeof, direct);
        }
        XErrorEvent(VoidPointer base) {
            super(base);
        }
        XErrorEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_resourceid(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 16 : 8, val);
        }
        public final long get_resourceid() {
            return byteBase.getCLong(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_error_code(byte val) {
            byteBase.set(NativeBridge.is64 ? 32 : 16, val);
        }
        public final byte get_error_code() {
            return byteBase.get(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_request_code(byte val) {
            byteBase.set(NativeBridge.is64 ? 33 : 17, val);
        }
        public final byte get_request_code() {
            return byteBase.get(NativeBridge.is64 ? 33 : 17);
        }
        public final void set_minor_code(byte val) {
            byteBase.set(NativeBridge.is64 ? 34 : 18, val);
        }
        public final byte get_minor_code() {
            return byteBase.get(NativeBridge.is64 ? 34 : 18);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XErrorEvent createXErrorEvent(boolean direct) {
        return new XErrorEvent(direct);
    }
    public final XErrorEvent createXErrorEvent(VoidPointer base) {
        return new XErrorEvent(base);
    }
    public final XErrorEvent createXErrorEvent(long addr) {
        return new XErrorEvent(addr);
    }


    public static class XClientMessageEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 96 : 48;

        XClientMessageEvent(boolean direct) {
            super(sizeof, direct);
        }
        XClientMessageEvent(VoidPointer base) {
            super(base);
        }
        XClientMessageEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_message_type(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_message_type() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_format(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_format() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public final Int8Pointer get_b() {
            return nb.createInt8Pointer(getElementPointer(NativeBridge.is64 ? 56 : 28));
        }
        public final Int16Pointer get_s() {
            return nb.createInt16Pointer(getElementPointer(NativeBridge.is64 ? 56 : 28));
        }
        public final CLongPointer get_l() {
            return nb.createCLongPointer(getElementPointer(NativeBridge.is64 ? 56 : 28));
        }
        public int size() {
            return sizeof;
        }
    }

    public final XClientMessageEvent createXClientMessageEvent(boolean direct) {
        return new XClientMessageEvent(direct);
    }
    public final XClientMessageEvent createXClientMessageEvent(VoidPointer base) {
        return new XClientMessageEvent(base);
    }
    public final XClientMessageEvent createXClientMessageEvent(long addr) {
        return new XClientMessageEvent(addr);
    }


    public static class XCirculateEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 28;

        XCirculateEvent(boolean direct) {
            super(sizeof, direct);
        }
        XCirculateEvent(VoidPointer base) {
            super(base);
        }
        XCirculateEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_event(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_event() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_place(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_place() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XCirculateEvent createXCirculateEvent(boolean direct) {
        return new XCirculateEvent(direct);
    }
    public final XCirculateEvent createXCirculateEvent(VoidPointer base) {
        return new XCirculateEvent(base);
    }
    public final XCirculateEvent createXCirculateEvent(long addr) {
        return new XCirculateEvent(addr);
    }


    public static class XMotionEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 96 : 60;

        XMotionEvent(boolean direct) {
            super(sizeof, direct);
        }
        XMotionEvent(VoidPointer base) {
            super(base);
        }
        XMotionEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_root(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_root() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_subwindow(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_subwindow() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_time(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 28, val);
        }
        public final long get_time() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 28);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 32, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 32);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 68 : 36, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 68 : 36);
        }
        public final void set_x_root(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 72 : 40, val);
        }
        public final int get_x_root() {
            return byteBase.getInt32(NativeBridge.is64 ? 72 : 40);
        }
        public final void set_y_root(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 76 : 44, val);
        }
        public final int get_y_root() {
            return byteBase.getInt32(NativeBridge.is64 ? 76 : 44);
        }
        public final void set_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 80 : 48, val);
        }
        public final int get_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 80 : 48);
        }
        public final void set_is_hint(byte val) {
            byteBase.set(NativeBridge.is64 ? 84 : 52, val);
        }
        public final byte get_is_hint() {
            return byteBase.get(NativeBridge.is64 ? 84 : 52);
        }
        public final void set_same_screen(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 88 : 56, val);
        }
        public final int get_same_screen() {
            return byteBase.getInt32(NativeBridge.is64 ? 88 : 56);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XMotionEvent createXMotionEvent(boolean direct) {
        return new XMotionEvent(direct);
    }
    public final XMotionEvent createXMotionEvent(VoidPointer base) {
        return new XMotionEvent(base);
    }
    public final XMotionEvent createXMotionEvent(long addr) {
        return new XMotionEvent(addr);
    }


    public static class XButtonEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 96 : 60;

        XButtonEvent(boolean direct) {
            super(sizeof, direct);
        }
        XButtonEvent(VoidPointer base) {
            super(base);
        }
        XButtonEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_root(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_root() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_subwindow(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_subwindow() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_time(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 28, val);
        }
        public final long get_time() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 28);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 32, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 32);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 68 : 36, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 68 : 36);
        }
        public final void set_x_root(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 72 : 40, val);
        }
        public final int get_x_root() {
            return byteBase.getInt32(NativeBridge.is64 ? 72 : 40);
        }
        public final void set_y_root(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 76 : 44, val);
        }
        public final int get_y_root() {
            return byteBase.getInt32(NativeBridge.is64 ? 76 : 44);
        }
        public final void set_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 80 : 48, val);
        }
        public final int get_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 80 : 48);
        }
        public final void set_button(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 84 : 52, val);
        }
        public final int get_button() {
            return byteBase.getInt32(NativeBridge.is64 ? 84 : 52);
        }
        public final void set_same_screen(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 88 : 56, val);
        }
        public final int get_same_screen() {
            return byteBase.getInt32(NativeBridge.is64 ? 88 : 56);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XButtonEvent createXButtonEvent(boolean direct) {
        return new XButtonEvent(direct);
    }
    public final XButtonEvent createXButtonEvent(VoidPointer base) {
        return new XButtonEvent(base);
    }
    public final XButtonEvent createXButtonEvent(long addr) {
        return new XButtonEvent(addr);
    }


    public static class XReparentEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 72 : 40;

        XReparentEvent(boolean direct) {
            super(sizeof, direct);
        }
        XReparentEvent(VoidPointer base) {
            super(base);
        }
        XReparentEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_event(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_event() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_parent(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_parent() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 28, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 28);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 60 : 32, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 60 : 32);
        }
        public final void set_override_redirect(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 36, val);
        }
        public final int get_override_redirect() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 36);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XReparentEvent createXReparentEvent(boolean direct) {
        return new XReparentEvent(direct);
    }
    public final XReparentEvent createXReparentEvent(VoidPointer base) {
        return new XReparentEvent(base);
    }
    public final XReparentEvent createXReparentEvent(long addr) {
        return new XReparentEvent(addr);
    }


    public static class XConfigureRequestEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 96 : 56;

        XConfigureRequestEvent(boolean direct) {
            super(sizeof, direct);
        }
        XConfigureRequestEvent(VoidPointer base) {
            super(base);
        }
        XConfigureRequestEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_parent(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_parent() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 28, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 28);
        }
        public final void set_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 32, val);
        }
        public final int get_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 32);
        }
        public final void set_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 60 : 36, val);
        }
        public final int get_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 60 : 36);
        }
        public final void set_border_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 40, val);
        }
        public final int get_border_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 40);
        }
        public final void set_above(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 72 : 44, val);
        }
        public final long get_above() {
            return byteBase.getCLong(NativeBridge.is64 ? 72 : 44);
        }
        public final void set_detail(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 80 : 48, val);
        }
        public final int get_detail() {
            return byteBase.getInt32(NativeBridge.is64 ? 80 : 48);
        }
        public final void set_value_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 88 : 52, val);
        }
        public final long get_value_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 88 : 52);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XConfigureRequestEvent createXConfigureRequestEvent(boolean direct) {
        return new XConfigureRequestEvent(direct);
    }
    public final XConfigureRequestEvent createXConfigureRequestEvent(VoidPointer base) {
        return new XConfigureRequestEvent(base);
    }
    public final XConfigureRequestEvent createXConfigureRequestEvent(long addr) {
        return new XConfigureRequestEvent(addr);
    }


    public static class XAnyEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 40 : 20;

        XAnyEvent(boolean direct) {
            super(sizeof, direct);
        }
        XAnyEvent(VoidPointer base) {
            super(base);
        }
        XAnyEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XAnyEvent createXAnyEvent(boolean direct) {
        return new XAnyEvent(direct);
    }
    public final XAnyEvent createXAnyEvent(VoidPointer base) {
        return new XAnyEvent(base);
    }
    public final XAnyEvent createXAnyEvent(long addr) {
        return new XAnyEvent(addr);
    }


    public static class XGravityEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 32;

        XGravityEvent(boolean direct) {
            super(sizeof, direct);
        }
        XGravityEvent(VoidPointer base) {
            super(base);
        }
        XGravityEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_event(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_event() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 28, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 28);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XGravityEvent createXGravityEvent(boolean direct) {
        return new XGravityEvent(direct);
    }
    public final XGravityEvent createXGravityEvent(VoidPointer base) {
        return new XGravityEvent(base);
    }
    public final XGravityEvent createXGravityEvent(long addr) {
        return new XGravityEvent(addr);
    }


    public static class XConfigureEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 88 : 52;

        XConfigureEvent(boolean direct) {
            super(sizeof, direct);
        }
        XConfigureEvent(VoidPointer base) {
            super(base);
        }
        XConfigureEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_event(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_event() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 28, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 28);
        }
        public final void set_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 32, val);
        }
        public final int get_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 32);
        }
        public final void set_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 60 : 36, val);
        }
        public final int get_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 60 : 36);
        }
        public final void set_border_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 40, val);
        }
        public final int get_border_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 40);
        }
        public final void set_above(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 72 : 44, val);
        }
        public final long get_above() {
            return byteBase.getCLong(NativeBridge.is64 ? 72 : 44);
        }
        public final void set_override_redirect(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 80 : 48, val);
        }
        public final int get_override_redirect() {
            return byteBase.getInt32(NativeBridge.is64 ? 80 : 48);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XConfigureEvent createXConfigureEvent(boolean direct) {
        return new XConfigureEvent(direct);
    }
    public final XConfigureEvent createXConfigureEvent(VoidPointer base) {
        return new XConfigureEvent(base);
    }
    public final XConfigureEvent createXConfigureEvent(long addr) {
        return new XConfigureEvent(addr);
    }


    public static class XPropertyEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 64 : 32;

        XPropertyEvent(boolean direct) {
            super(sizeof, direct);
        }
        XPropertyEvent(VoidPointer base) {
            super(base);
        }
        XPropertyEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_atom(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_atom() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_time(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_time() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 28, val);
        }
        public final int get_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 28);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XPropertyEvent createXPropertyEvent(boolean direct) {
        return new XPropertyEvent(direct);
    }
    public final XPropertyEvent createXPropertyEvent(VoidPointer base) {
        return new XPropertyEvent(base);
    }
    public final XPropertyEvent createXPropertyEvent(long addr) {
        return new XPropertyEvent(addr);
    }


    public static class XSelectionClearEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 28;

        XSelectionClearEvent(boolean direct) {
            super(sizeof, direct);
        }
        XSelectionClearEvent(VoidPointer base) {
            super(base);
        }
        XSelectionClearEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_selection(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_selection() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_time(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_time() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XSelectionClearEvent createXSelectionClearEvent(boolean direct) {
        return new XSelectionClearEvent(direct);
    }
    public final XSelectionClearEvent createXSelectionClearEvent(VoidPointer base) {
        return new XSelectionClearEvent(base);
    }
    public final XSelectionClearEvent createXSelectionClearEvent(long addr) {
        return new XSelectionClearEvent(addr);
    }


    public static class XMapEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 56 : 28;

        XMapEvent(boolean direct) {
            super(sizeof, direct);
        }
        XMapEvent(VoidPointer base) {
            super(base);
        }
        XMapEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_event(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_event() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_override_redirect(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 24, val);
        }
        public final int get_override_redirect() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 24);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XMapEvent createXMapEvent(boolean direct) {
        return new XMapEvent(direct);
    }
    public final XMapEvent createXMapEvent(VoidPointer base) {
        return new XMapEvent(base);
    }
    public final XMapEvent createXMapEvent(long addr) {
        return new XMapEvent(addr);
    }


    public static class XDestroyWindowEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 48 : 24;

        XDestroyWindowEvent(boolean direct) {
            super(sizeof, direct);
        }
        XDestroyWindowEvent(VoidPointer base) {
            super(base);
        }
        XDestroyWindowEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_event(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_event() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XDestroyWindowEvent createXDestroyWindowEvent(boolean direct) {
        return new XDestroyWindowEvent(direct);
    }
    public final XDestroyWindowEvent createXDestroyWindowEvent(VoidPointer base) {
        return new XDestroyWindowEvent(base);
    }
    public final XDestroyWindowEvent createXDestroyWindowEvent(long addr) {
        return new XDestroyWindowEvent(addr);
    }


    public static class XMapRequestEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 48 : 24;

        XMapRequestEvent(boolean direct) {
            super(sizeof, direct);
        }
        XMapRequestEvent(VoidPointer base) {
            super(base);
        }
        XMapRequestEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_parent(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_parent() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XMapRequestEvent createXMapRequestEvent(boolean direct) {
        return new XMapRequestEvent(direct);
    }
    public final XMapRequestEvent createXMapRequestEvent(VoidPointer base) {
        return new XMapRequestEvent(base);
    }
    public final XMapRequestEvent createXMapRequestEvent(long addr) {
        return new XMapRequestEvent(addr);
    }


    public static class XGraphicsExposeEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 72 : 48;

        XGraphicsExposeEvent(boolean direct) {
            super(sizeof, direct);
        }
        XGraphicsExposeEvent(VoidPointer base) {
            super(base);
        }
        XGraphicsExposeEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_drawable(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_drawable() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 20, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 24, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 24);
        }
        public final void set_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 28, val);
        }
        public final int get_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 28);
        }
        public final void set_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 32, val);
        }
        public final int get_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 32);
        }
        public final void set_count(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 36, val);
        }
        public final int get_count() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 36);
        }
        public final void set_major_code(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 60 : 40, val);
        }
        public final int get_major_code() {
            return byteBase.getInt32(NativeBridge.is64 ? 60 : 40);
        }
        public final void set_minor_code(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 44, val);
        }
        public final int get_minor_code() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 44);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XGraphicsExposeEvent createXGraphicsExposeEvent(boolean direct) {
        return new XGraphicsExposeEvent(direct);
    }
    public final XGraphicsExposeEvent createXGraphicsExposeEvent(VoidPointer base) {
        return new XGraphicsExposeEvent(base);
    }
    public final XGraphicsExposeEvent createXGraphicsExposeEvent(long addr) {
        return new XGraphicsExposeEvent(addr);
    }


    public static class XCrossingEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 104 : 68;

        XCrossingEvent(boolean direct) {
            super(sizeof, direct);
        }
        XCrossingEvent(VoidPointer base) {
            super(base);
        }
        XCrossingEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_root(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_root() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_subwindow(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_subwindow() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_time(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 28, val);
        }
        public final long get_time() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 28);
        }
        public final void set_x(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 32, val);
        }
        public final int get_x() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 32);
        }
        public final void set_y(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 68 : 36, val);
        }
        public final int get_y() {
            return byteBase.getInt32(NativeBridge.is64 ? 68 : 36);
        }
        public final void set_x_root(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 72 : 40, val);
        }
        public final int get_x_root() {
            return byteBase.getInt32(NativeBridge.is64 ? 72 : 40);
        }
        public final void set_y_root(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 76 : 44, val);
        }
        public final int get_y_root() {
            return byteBase.getInt32(NativeBridge.is64 ? 76 : 44);
        }
        public final void set_mode(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 80 : 48, val);
        }
        public final int get_mode() {
            return byteBase.getInt32(NativeBridge.is64 ? 80 : 48);
        }
        public final void set_detail(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 84 : 52, val);
        }
        public final int get_detail() {
            return byteBase.getInt32(NativeBridge.is64 ? 84 : 52);
        }
        public final void set_same_screen(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 88 : 56, val);
        }
        public final int get_same_screen() {
            return byteBase.getInt32(NativeBridge.is64 ? 88 : 56);
        }
        public final void set_focus(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 92 : 60, val);
        }
        public final int get_focus() {
            return byteBase.getInt32(NativeBridge.is64 ? 92 : 60);
        }
        public final void set_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 96 : 64, val);
        }
        public final int get_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 96 : 64);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XCrossingEvent createXCrossingEvent(boolean direct) {
        return new XCrossingEvent(direct);
    }
    public final XCrossingEvent createXCrossingEvent(VoidPointer base) {
        return new XCrossingEvent(base);
    }
    public final XCrossingEvent createXCrossingEvent(long addr) {
        return new XCrossingEvent(addr);
    }


    public static class XKeymapEvent extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 72 : 52;

        XKeymapEvent(boolean direct) {
            super(sizeof, direct);
        }
        XKeymapEvent(VoidPointer base) {
            super(base);
        }
        XKeymapEvent(long addr) {
            super(addr);
        }
        public final void set_type(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_type() {
            return byteBase.getInt32(0);
        }
        public final void set_serial(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_serial() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_send_event(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 16 : 8, val);
        }
        public final int get_send_event() {
            return byteBase.getInt32(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_window(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_window() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final Int8Pointer get_key_vector() {
            return nb.createInt8Pointer(getElementPointer(NativeBridge.is64 ? 40 : 20));
        }
        public int size() {
            return sizeof;
        }
    }

    public final XKeymapEvent createXKeymapEvent(boolean direct) {
        return new XKeymapEvent(direct);
    }
    public final XKeymapEvent createXKeymapEvent(VoidPointer base) {
        return new XKeymapEvent(base);
    }
    public final XKeymapEvent createXKeymapEvent(long addr) {
        return new XKeymapEvent(addr);
    }

    public final int XPutImage(long param_0, long param_1, long param_2, X11.XImage param_3, int param_4, int param_5, int param_6, int param_7, int param_8, int param_9) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XPutImage(param_0, param_1, param_2, tmp_0, param_4, param_5, param_6, param_7, param_8, param_9);
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XPutImage(long param_0, long param_1, long param_2, long param_3, int param_4, int param_5, int param_6, int param_7, int param_8, int param_9);

    public final native int XmuLookupStandardColormap(long dpy, int screen, long visualid, int depth, long property, int replace, int retain);

    public final int XStoreName(long param_0, long param_1, String param_2) {
        Int8Pointer _param_2 = null == param_2? null :  nb.createInt8Pointer(param_2, false);
        long tmp_0 = _param_2 == null ? 0 : _param_2.longLockPointer();
        int tmp_ret = XStoreName(param_0, param_1, tmp_0);
        if (_param_2 != null) {
            _param_2.unlock();
            _param_2.free();
        }
        return tmp_ret;
    }
    public final int XStoreName(long param_0, long param_1, Int8Pointer param_2) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XStoreName(param_0, param_1, tmp_0);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XStoreName(long param_0, long param_1, long param_2);

    public final native long XAllocStandardColormap();


    public static class XStandardColormap extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 80 : 40;

        XStandardColormap(boolean direct) {
            super(sizeof, direct);
        }
        XStandardColormap(VoidPointer base) {
            super(base);
        }
        XStandardColormap(long addr) {
            super(addr);
        }
        public final void set_colormap(long val) {
            byteBase.setCLong(0, val);
        }
        public final long get_colormap() {
            return byteBase.getCLong(0);
        }
        public final void set_red_max(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_red_max() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_red_mult(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 16 : 8, val);
        }
        public final long get_red_mult() {
            return byteBase.getCLong(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_green_max(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_green_max() {
            return byteBase.getCLong(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_green_mult(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 16, val);
        }
        public final long get_green_mult() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_blue_max(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 40 : 20, val);
        }
        public final long get_blue_max() {
            return byteBase.getCLong(NativeBridge.is64 ? 40 : 20);
        }
        public final void set_blue_mult(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 24, val);
        }
        public final long get_blue_mult() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 24);
        }
        public final void set_base_pixel(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 28, val);
        }
        public final long get_base_pixel() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 28);
        }
        public final void set_visualid(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 64 : 32, val);
        }
        public final long get_visualid() {
            return byteBase.getCLong(NativeBridge.is64 ? 64 : 32);
        }
        public final void set_killid(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 72 : 36, val);
        }
        public final long get_killid() {
            return byteBase.getCLong(NativeBridge.is64 ? 72 : 36);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XStandardColormap createXStandardColormap(boolean direct) {
        return new XStandardColormap(direct);
    }
    public final XStandardColormap createXStandardColormap(VoidPointer base) {
        return new XStandardColormap(base);
    }
    public final XStandardColormap createXStandardColormap(long addr) {
        return new XStandardColormap(addr);
    }

    public final int XSetClipRectangles(long param_0, long param_1, int param_2, int param_3, X11.XRectangle param_4, int param_5, int param_6) {
        long tmp_0 = param_4 == null ? 0 : param_4.longLockPointer();
        int tmp_ret = XSetClipRectangles(param_0, param_1, param_2, param_3, tmp_0, param_5, param_6);
        if (param_4 != null) {
            param_4.unlock();
        }
        return tmp_ret;
    }
    public final native int XSetClipRectangles(long param_0, long param_1, int param_2, int param_3, long param_4, int param_5, int param_6);

    public final int XChangeWindowAttributes(long param_0, long param_1, long param_2, XSetWindowAttributes param_3) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XChangeWindowAttributes(param_0, param_1, param_2, tmp_0);
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XChangeWindowAttributes(long param_0, long param_1, long param_2, long param_3);


    public static class XSetWindowAttributes extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 112 : 60;

        XSetWindowAttributes(boolean direct) {
            super(sizeof, direct);
        }
        XSetWindowAttributes(VoidPointer base) {
            super(base);
        }
        XSetWindowAttributes(long addr) {
            super(addr);
        }
        public final void set_background_pixmap(long val) {
            byteBase.setCLong(0, val);
        }
        public final long get_background_pixmap() {
            return byteBase.getCLong(0);
        }
        public final void set_background_pixel(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_background_pixel() {
            return byteBase.getCLong(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_border_pixmap(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 16 : 8, val);
        }
        public final long get_border_pixmap() {
            return byteBase.getCLong(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_border_pixel(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 24 : 12, val);
        }
        public final long get_border_pixel() {
            return byteBase.getCLong(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_bit_gravity(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 32 : 16, val);
        }
        public final int get_bit_gravity() {
            return byteBase.getInt32(NativeBridge.is64 ? 32 : 16);
        }
        public final void set_win_gravity(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 36 : 20, val);
        }
        public final int get_win_gravity() {
            return byteBase.getInt32(NativeBridge.is64 ? 36 : 20);
        }
        public final void set_backing_store(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 24, val);
        }
        public final int get_backing_store() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 24);
        }
        public final void set_backing_planes(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 48 : 28, val);
        }
        public final long get_backing_planes() {
            return byteBase.getCLong(NativeBridge.is64 ? 48 : 28);
        }
        public final void set_backing_pixel(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 32, val);
        }
        public final long get_backing_pixel() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 32);
        }
        public final void set_save_under(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 64 : 36, val);
        }
        public final int get_save_under() {
            return byteBase.getInt32(NativeBridge.is64 ? 64 : 36);
        }
        public final void set_event_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 72 : 40, val);
        }
        public final long get_event_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 72 : 40);
        }
        public final void set_do_not_propagate_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 80 : 44, val);
        }
        public final long get_do_not_propagate_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 80 : 44);
        }
        public final void set_override_redirect(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 88 : 48, val);
        }
        public final int get_override_redirect() {
            return byteBase.getInt32(NativeBridge.is64 ? 88 : 48);
        }
        public final void set_colormap(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 96 : 52, val);
        }
        public final long get_colormap() {
            return byteBase.getCLong(NativeBridge.is64 ? 96 : 52);
        }
        public final void set_cursor(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 104 : 56, val);
        }
        public final long get_cursor() {
            return byteBase.getCLong(NativeBridge.is64 ? 104 : 56);
        }
        public int size() {
            return sizeof;
        }
    }

    public final XSetWindowAttributes createXSetWindowAttributes(boolean direct) {
        return new XSetWindowAttributes(direct);
    }
    public final XSetWindowAttributes createXSetWindowAttributes(VoidPointer base) {
        return new XSetWindowAttributes(base);
    }
    public final XSetWindowAttributes createXSetWindowAttributes(long addr) {
        return new XSetWindowAttributes(addr);
    }

    public final native long XDisplayString(long param_0);

    public final native int XSetFillRule(long param_0, long param_1, int param_2);

    public final int XInitImage(X11.XImage param_0) {
        long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
        int tmp_ret = XInitImage(tmp_0);
        if (param_0 != null) {
            param_0.unlock();
        }
        return tmp_ret;
    }
    public final native int XInitImage(long param_0);

    public final int XSetDashes(long param_0, long param_1, int param_2, String param_3, int param_4) {
        Int8Pointer _param_3 = null == param_3? null :  nb.createInt8Pointer(param_3, false);
        long tmp_0 = _param_3 == null ? 0 : _param_3.longLockPointer();
        int tmp_ret = XSetDashes(param_0, param_1, param_2, tmp_0, param_4);
        if (_param_3 != null) {
            _param_3.unlock();
            _param_3.free();
        }
        return tmp_ret;
    }
    public final int XSetDashes(long param_0, long param_1, int param_2, Int8Pointer param_3, int param_4) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XSetDashes(param_0, param_1, param_2, tmp_0, param_4);
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XSetDashes(long param_0, long param_1, int param_2, long param_3, int param_4);

    public final int XSetWMHints(long param_0, long param_1, X11.XWMHints param_2) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XSetWMHints(param_0, param_1, tmp_0);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XSetWMHints(long param_0, long param_1, long param_2);

    public final native int XPending(long param_0);

    public final long XVisualIDFromVisual(X11.Visual param_0) {
        long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
        long tmp_ret = XVisualIDFromVisual(tmp_0);
        if (param_0 != null) {
            param_0.unlock();
        }
        return tmp_ret;
    }
    public final native long XVisualIDFromVisual(long param_0);

    public final int XSendEvent(long param_0, long param_1, int param_2, long param_3, X11.XEvent param_4) {
        long tmp_0 = param_4 == null ? 0 : param_4.longLockPointer();
        int tmp_ret = XSendEvent(param_0, param_1, param_2, param_3, tmp_0);
        if (param_4 != null) {
            param_4.unlock();
        }
        return tmp_ret;
    }
    public final native int XSendEvent(long param_0, long param_1, int param_2, long param_3, long param_4);

    public final native int XDrawLine(long param_0, long param_1, long param_2, int param_3, int param_4, int param_5, int param_6);

    public final native long XCreatePixmap(long param_0, long param_1, int param_2, int param_3, int param_4);

    public final native int XDefineCursor(long param_0, long param_1, long param_2);

    public final int XDrawLines(long param_0, long param_1, long param_2, X11.XPoint param_3, int param_4, int param_5) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XDrawLines(param_0, param_1, param_2, tmp_0, param_4, param_5);
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XDrawLines(long param_0, long param_1, long param_2, long param_3, int param_4, int param_5);

    public final void XSetWMNormalHints(long param_0, long param_1, X11.XSizeHints param_2) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        XSetWMNormalHints(param_0, param_1, tmp_0);
        if (param_2 != null) {
            param_2.unlock();
        }
    }
    public final native void XSetWMNormalHints(long param_0, long param_1, long param_2);

    public final int XTranslateCoordinates(long param_0, long param_1, long param_2, int param_3, int param_4, Int32Pointer param_5, Int32Pointer param_6, CLongPointer param_7) {
        long tmp_0 = param_5 == null ? 0 : param_5.longLockPointer();
        long tmp_1 = param_6 == null ? 0 : param_6.longLockPointer();
        long tmp_2 = param_7 == null ? 0 : param_7.longLockPointer();
        int tmp_ret = XTranslateCoordinates(param_0, param_1, param_2, param_3, param_4, tmp_0, tmp_1, tmp_2);
        if (param_5 != null) {
            param_5.unlock();
        }
        if (param_6 != null) {
            param_6.unlock();
        }
        if (param_7 != null) {
            param_7.unlock();
        }
        return tmp_ret;
    }
    public final native int XTranslateCoordinates(long param_0, long param_1, long param_2, int param_3, int param_4, long param_5, long param_6, long param_7);

    public final int XSetStandardProperties(long param_0, long param_1, String param_2, String param_3, long param_4, PointerPointer param_5, int param_6, X11.XSizeHints param_7) {
        Int8Pointer _param_2 = null == param_2? null :  nb.createInt8Pointer(param_2, false);
        long tmp_0 = _param_2 == null ? 0 : _param_2.longLockPointer();
        Int8Pointer _param_3 = null == param_3? null :  nb.createInt8Pointer(param_3, false);
        long tmp_1 = _param_3 == null ? 0 : _param_3.longLockPointer();
        long tmp_2 = param_5 == null ? 0 : param_5.longLockPointer();
        long tmp_3 = param_7 == null ? 0 : param_7.longLockPointer();
        int tmp_ret = XSetStandardProperties(param_0, param_1, tmp_0, tmp_1, param_4, tmp_2, param_6, tmp_3);
        if (_param_2 != null) {
            _param_2.unlock();
            _param_2.free();
        }
        if (_param_3 != null) {
            _param_3.unlock();
            _param_3.free();
        }
        if (param_5 != null) {
            param_5.unlock();
        }
        if (param_7 != null) {
            param_7.unlock();
        }
        return tmp_ret;
    }
    public final int XSetStandardProperties(long param_0, long param_1, Int8Pointer param_2, Int8Pointer param_3, long param_4, PointerPointer param_5, int param_6, X11.XSizeHints param_7) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_2 = param_5 == null ? 0 : param_5.longLockPointer();
        long tmp_3 = param_7 == null ? 0 : param_7.longLockPointer();
        int tmp_ret = XSetStandardProperties(param_0, param_1, tmp_0, tmp_1, param_4, tmp_2, param_6, tmp_3);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        if (param_5 != null) {
            param_5.unlock();
        }
        if (param_7 != null) {
            param_7.unlock();
        }
        return tmp_ret;
    }
    public final native int XSetStandardProperties(long param_0, long param_1, long param_2, long param_3, long param_4, long param_5, int param_6, long param_7);

    public final void Xutf8SetWMProperties(long param_0, long param_1, String param_2, String param_3, PointerPointer param_4, int param_5, X11.XSizeHints param_6, X11.XWMHints param_7, PointerPointer param_8) {
        Int8Pointer _param_2 = null == param_2? null :  nb.createInt8Pointer(param_2, false);
        long tmp_0 = _param_2 == null ? 0 : _param_2.longLockPointer();
        Int8Pointer _param_3 = null == param_3? null :  nb.createInt8Pointer(param_3, false);
        long tmp_1 = _param_3 == null ? 0 : _param_3.longLockPointer();
        long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
        long tmp_3 = param_6 == null ? 0 : param_6.longLockPointer();
        long tmp_4 = param_7 == null ? 0 : param_7.longLockPointer();
        long tmp_5 = param_8 == null ? 0 : param_8.longLockPointer();
        Xutf8SetWMProperties(param_0, param_1, tmp_0, tmp_1, tmp_2, param_5, tmp_3, tmp_4, tmp_5);
        if (_param_2 != null) {
            _param_2.unlock();
            _param_2.free();
        }
        if (_param_3 != null) {
            _param_3.unlock();
            _param_3.free();
        }
        if (param_4 != null) {
            param_4.unlock();
        }
        if (param_6 != null) {
            param_6.unlock();
        }
        if (param_7 != null) {
            param_7.unlock();
        }
        if (param_8 != null) {
            param_8.unlock();
        }
    }
    public final void Xutf8SetWMProperties(long param_0, long param_1, Int8Pointer param_2, Int8Pointer param_3, PointerPointer param_4, int param_5, X11.XSizeHints param_6, X11.XWMHints param_7, PointerPointer param_8) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
        long tmp_3 = param_6 == null ? 0 : param_6.longLockPointer();
        long tmp_4 = param_7 == null ? 0 : param_7.longLockPointer();
        long tmp_5 = param_8 == null ? 0 : param_8.longLockPointer();
        Xutf8SetWMProperties(param_0, param_1, tmp_0, tmp_1, tmp_2, param_5, tmp_3, tmp_4, tmp_5);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        if (param_4 != null) {
            param_4.unlock();
        }
        if (param_6 != null) {
            param_6.unlock();
        }
        if (param_7 != null) {
            param_7.unlock();
        }
        if (param_8 != null) {
            param_8.unlock();
        }
    }
    public final native void Xutf8SetWMProperties(long param_0, long param_1, long param_2, long param_3, long param_4, int param_5, long param_6, long param_7, long param_8);

    public final native long XDefaultColormap(long param_0, int param_1);

    public final native long XAllocSizeHints();

    public final native int XFlush(long param_0);

    public final int XGetWindowAttributes(long param_0, long param_1, XWindowAttributes param_2) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XGetWindowAttributes(param_0, param_1, tmp_0);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XGetWindowAttributes(long param_0, long param_1, long param_2);


    public static class XWindowAttributes extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 136 : 92;

        XWindowAttributes(boolean direct) {
            super(sizeof, direct);
        }
        XWindowAttributes(VoidPointer base) {
            super(base);
        }
        XWindowAttributes(long addr) {
            super(addr);
        }
        public final void set_x(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_x() {
            return byteBase.getInt32(0);
        }
        public final void set_y(int val) {
            byteBase.setInt32(4, val);
        }
        public final int get_y() {
            return byteBase.getInt32(4);
        }
        public final void set_width(int val) {
            byteBase.setInt32(8, val);
        }
        public final int get_width() {
            return byteBase.getInt32(8);
        }
        public final void set_height(int val) {
            byteBase.setInt32(12, val);
        }
        public final int get_height() {
            return byteBase.getInt32(12);
        }
        public final void set_border_width(int val) {
            byteBase.setInt32(16, val);
        }
        public final int get_border_width() {
            return byteBase.getInt32(16);
        }
        public final void set_depth(int val) {
            byteBase.setInt32(20, val);
        }
        public final int get_depth() {
            return byteBase.getInt32(20);
        }
        public final X11.Visual get_visual() {
            return X11.instance.createVisual(byteBase.getAddress(24));
        }
        public final void set_root(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 32 : 28, val);
        }
        public final long get_root() {
            return byteBase.getCLong(NativeBridge.is64 ? 32 : 28);
        }
        public final void set_class(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 32, val);
        }
        public final int get_class() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 32);
        }
        public final void set_bit_gravity(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 44 : 36, val);
        }
        public final int get_bit_gravity() {
            return byteBase.getInt32(NativeBridge.is64 ? 44 : 36);
        }
        public final void set_win_gravity(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 48 : 40, val);
        }
        public final int get_win_gravity() {
            return byteBase.getInt32(NativeBridge.is64 ? 48 : 40);
        }
        public final void set_backing_store(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 52 : 44, val);
        }
        public final int get_backing_store() {
            return byteBase.getInt32(NativeBridge.is64 ? 52 : 44);
        }
        public final void set_backing_planes(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 56 : 48, val);
        }
        public final long get_backing_planes() {
            return byteBase.getCLong(NativeBridge.is64 ? 56 : 48);
        }
        public final void set_backing_pixel(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 64 : 52, val);
        }
        public final long get_backing_pixel() {
            return byteBase.getCLong(NativeBridge.is64 ? 64 : 52);
        }
        public final void set_save_under(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 72 : 56, val);
        }
        public final int get_save_under() {
            return byteBase.getInt32(NativeBridge.is64 ? 72 : 56);
        }
        public final void set_colormap(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 80 : 60, val);
        }
        public final long get_colormap() {
            return byteBase.getCLong(NativeBridge.is64 ? 80 : 60);
        }
        public final void set_map_installed(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 88 : 64, val);
        }
        public final int get_map_installed() {
            return byteBase.getInt32(NativeBridge.is64 ? 88 : 64);
        }
        public final void set_map_state(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 92 : 68, val);
        }
        public final int get_map_state() {
            return byteBase.getInt32(NativeBridge.is64 ? 92 : 68);
        }
        public final void set_all_event_masks(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 96 : 72, val);
        }
        public final long get_all_event_masks() {
            return byteBase.getCLong(NativeBridge.is64 ? 96 : 72);
        }
        public final void set_your_event_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 104 : 76, val);
        }
        public final long get_your_event_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 104 : 76);
        }
        public final void set_do_not_propagate_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 112 : 80, val);
        }
        public final long get_do_not_propagate_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 112 : 80);
        }
        public final void set_override_redirect(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 120 : 84, val);
        }
        public final int get_override_redirect() {
            return byteBase.getInt32(NativeBridge.is64 ? 120 : 84);
        }
        public final Screen get_screen() {
            return instance.createScreen(byteBase.getAddress(NativeBridge.is64 ? 128 : 88));
        }
        public int size() {
            return sizeof;
        }
    }

    public final XWindowAttributes createXWindowAttributes(boolean direct) {
        return new XWindowAttributes(direct);
    }
    public final XWindowAttributes createXWindowAttributes(VoidPointer base) {
        return new XWindowAttributes(base);
    }
    public final XWindowAttributes createXWindowAttributes(long addr) {
        return new XWindowAttributes(addr);
    }


    public static class Screen extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 128 : 80;

        Screen(boolean direct) {
            super(sizeof, direct);
        }
        Screen(VoidPointer base) {
            super(base);
        }
        Screen(long addr) {
            super(addr);
        }
        public final X11.XExtData get_ext_data() {
            return X11.instance.createXExtData(byteBase.getAddress(0));
        }
        public final void set_display(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 8 : 4, val);
        }
        public final long get_display() {
            return byteBase.getAddress(NativeBridge.is64 ? 8 : 4);
        }
        public final void set_root(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 16 : 8, val);
        }
        public final long get_root() {
            return byteBase.getCLong(NativeBridge.is64 ? 16 : 8);
        }
        public final void set_width(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 24 : 12, val);
        }
        public final int get_width() {
            return byteBase.getInt32(NativeBridge.is64 ? 24 : 12);
        }
        public final void set_height(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 28 : 16, val);
        }
        public final int get_height() {
            return byteBase.getInt32(NativeBridge.is64 ? 28 : 16);
        }
        public final void set_mwidth(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 32 : 20, val);
        }
        public final int get_mwidth() {
            return byteBase.getInt32(NativeBridge.is64 ? 32 : 20);
        }
        public final void set_mheight(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 36 : 24, val);
        }
        public final int get_mheight() {
            return byteBase.getInt32(NativeBridge.is64 ? 36 : 24);
        }
        public final void set_ndepths(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 40 : 28, val);
        }
        public final int get_ndepths() {
            return byteBase.getInt32(NativeBridge.is64 ? 40 : 28);
        }
        public final Depth get_depths() {
            return instance.createDepth(byteBase.getAddress(NativeBridge.is64 ? 48 : 32));
        }
        public final void set_root_depth(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 56 : 36, val);
        }
        public final int get_root_depth() {
            return byteBase.getInt32(NativeBridge.is64 ? 56 : 36);
        }
        public final X11.Visual get_root_visual() {
            return X11.instance.createVisual(byteBase.getAddress(NativeBridge.is64 ? 64 : 40));
        }
        public final void set_default_gc(long val) {
            byteBase.setAddress(NativeBridge.is64 ? 72 : 44, val);
        }
        public final long get_default_gc() {
            return byteBase.getAddress(NativeBridge.is64 ? 72 : 44);
        }
        public final void set_cmap(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 80 : 48, val);
        }
        public final long get_cmap() {
            return byteBase.getCLong(NativeBridge.is64 ? 80 : 48);
        }
        public final void set_white_pixel(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 88 : 52, val);
        }
        public final long get_white_pixel() {
            return byteBase.getCLong(NativeBridge.is64 ? 88 : 52);
        }
        public final void set_black_pixel(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 96 : 56, val);
        }
        public final long get_black_pixel() {
            return byteBase.getCLong(NativeBridge.is64 ? 96 : 56);
        }
        public final void set_max_maps(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 104 : 60, val);
        }
        public final int get_max_maps() {
            return byteBase.getInt32(NativeBridge.is64 ? 104 : 60);
        }
        public final void set_min_maps(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 108 : 64, val);
        }
        public final int get_min_maps() {
            return byteBase.getInt32(NativeBridge.is64 ? 108 : 64);
        }
        public final void set_backing_store(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 112 : 68, val);
        }
        public final int get_backing_store() {
            return byteBase.getInt32(NativeBridge.is64 ? 112 : 68);
        }
        public final void set_save_unders(int val) {
            byteBase.setInt32(NativeBridge.is64 ? 116 : 72, val);
        }
        public final int get_save_unders() {
            return byteBase.getInt32(NativeBridge.is64 ? 116 : 72);
        }
        public final void set_root_input_mask(long val) {
            byteBase.setCLong(NativeBridge.is64 ? 120 : 76, val);
        }
        public final long get_root_input_mask() {
            return byteBase.getCLong(NativeBridge.is64 ? 120 : 76);
        }
        public int size() {
            return sizeof;
        }
    }

    public final Screen createScreen(boolean direct) {
        return new Screen(direct);
    }
    public final Screen createScreen(VoidPointer base) {
        return new Screen(base);
    }
    public final Screen createScreen(long addr) {
        return new Screen(addr);
    }


    public static class Depth extends CommonStructWrapper {

        public static final int sizeof = NativeBridge.is64 ? 16 : 12;

        Depth(boolean direct) {
            super(sizeof, direct);
        }
        Depth(VoidPointer base) {
            super(base);
        }
        Depth(long addr) {
            super(addr);
        }
        public final void set_depth(int val) {
            byteBase.setInt32(0, val);
        }
        public final int get_depth() {
            return byteBase.getInt32(0);
        }
        public final void set_nvisuals(int val) {
            byteBase.setInt32(4, val);
        }
        public final int get_nvisuals() {
            return byteBase.getInt32(4);
        }
        public final X11.Visual get_visuals() {
            return X11.instance.createVisual(byteBase.getAddress(8));
        }
        public int size() {
            return sizeof;
        }
    }

    public final Depth createDepth(boolean direct) {
        return new Depth(direct);
    }
    public final Depth createDepth(VoidPointer base) {
        return new Depth(base);
    }
    public final Depth createDepth(long addr) {
        return new Depth(addr);
    }

    public final native int XFreePixmap(long param_0, long param_1);

    public final int XGetGeometry(long param_0, long param_1, CLongPointer param_2, Int32Pointer param_3, Int32Pointer param_4, Int32Pointer param_5, Int32Pointer param_6, Int32Pointer param_7, Int32Pointer param_8) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
        long tmp_3 = param_5 == null ? 0 : param_5.longLockPointer();
        long tmp_4 = param_6 == null ? 0 : param_6.longLockPointer();
        long tmp_5 = param_7 == null ? 0 : param_7.longLockPointer();
        long tmp_6 = param_8 == null ? 0 : param_8.longLockPointer();
        int tmp_ret = XGetGeometry(param_0, param_1, tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, tmp_5, tmp_6);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        if (param_4 != null) {
            param_4.unlock();
        }
        if (param_5 != null) {
            param_5.unlock();
        }
        if (param_6 != null) {
            param_6.unlock();
        }
        if (param_7 != null) {
            param_7.unlock();
        }
        if (param_8 != null) {
            param_8.unlock();
        }
        return tmp_ret;
    }
    public final native int XGetGeometry(long param_0, long param_1, long param_2, long param_3, long param_4, long param_5, long param_6, long param_7, long param_8);

    public final int XQueryColors(long param_0, long param_1, X11.XColor param_2, int param_3) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XQueryColors(param_0, param_1, tmp_0, param_3);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XQueryColors(long param_0, long param_1, long param_2, int param_3);

    public final int XQueryBestCursor(long param_0, long param_1, int param_2, int param_3, Int32Pointer param_4, Int32Pointer param_5) {
        long tmp_0 = param_4 == null ? 0 : param_4.longLockPointer();
        long tmp_1 = param_5 == null ? 0 : param_5.longLockPointer();
        int tmp_ret = XQueryBestCursor(param_0, param_1, param_2, param_3, tmp_0, tmp_1);
        if (param_4 != null) {
            param_4.unlock();
        }
        if (param_5 != null) {
            param_5.unlock();
        }
        return tmp_ret;
    }
    public final native int XQueryBestCursor(long param_0, long param_1, int param_2, int param_3, long param_4, long param_5);

    public final int XNextEvent(long param_0, X11.XEvent param_1) {
        long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
        int tmp_ret = XNextEvent(param_0, tmp_0);
        if (param_1 != null) {
            param_1.unlock();
        }
        return tmp_ret;
    }
    public final native int XNextEvent(long param_0, long param_1);

    public final native long XDefaultVisual(long param_0, int param_1);

    public final long XCreateWindow(long param_0, long param_1, int param_2, int param_3, int param_4, int param_5, int param_6, int param_7, int param_8, X11.Visual param_9, long param_10, X11.XSetWindowAttributes param_11) {
        long tmp_0 = param_9 == null ? 0 : param_9.longLockPointer();
        long tmp_1 = param_11 == null ? 0 : param_11.longLockPointer();
        long tmp_ret = XCreateWindow(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, tmp_0, param_10, tmp_1);
        if (param_9 != null) {
            param_9.unlock();
        }
        if (param_11 != null) {
            param_11.unlock();
        }
        return tmp_ret;
    }
    public final native long XCreateWindow(long param_0, long param_1, int param_2, int param_3, int param_4, int param_5, int param_6, int param_7, int param_8, long param_9, long param_10, long param_11);

    public final native int XFreeGC(long param_0, long param_1);

    public final native int XBitmapPad(long param_0);

    public final long XCreateColormap(long param_0, long param_1, X11.Visual param_2, int param_3) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_ret = XCreateColormap(param_0, param_1, tmp_0, param_3);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native long XCreateColormap(long param_0, long param_1, long param_2, int param_3);

    public final int XGetPointerMapping(long param_0, Int8Pointer param_1, int param_2) {
        long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
        int tmp_ret = XGetPointerMapping(param_0, tmp_0, param_2);
        if (param_1 != null) {
            param_1.unlock();
        }
        return tmp_ret;
    }
    public final native int XGetPointerMapping(long param_0, long param_1, int param_2);

    public final native long XSetErrorHandler(long param_0);

    public final native int XSetTransientForHint(long param_0, long param_1, long param_2);

    public final native int XFreeCursor(long param_0, long param_1);

    public final native int XFillRectangle(long param_0, long param_1, long param_2, int param_3, int param_4, int param_5, int param_6);

    public final int XSetWMProtocols(long param_0, long param_1, CLongPointer param_2, int param_3) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XSetWMProtocols(param_0, param_1, tmp_0, param_3);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XSetWMProtocols(long param_0, long param_1, long param_2, int param_3);

    public final native int XCloseDisplay(long param_0);

    public final int XQueryTree(long param_0, long param_1, CLongPointer param_2, CLongPointer param_3, PointerPointer param_4, Int32Pointer param_5) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
        long tmp_3 = param_5 == null ? 0 : param_5.longLockPointer();
        int tmp_ret = XQueryTree(param_0, param_1, tmp_0, tmp_1, tmp_2, tmp_3);
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        if (param_4 != null) {
            param_4.unlock();
        }
        if (param_5 != null) {
            param_5.unlock();
        }
        return tmp_ret;
    }
    public final native int XQueryTree(long param_0, long param_1, long param_2, long param_3, long param_4, long param_5);

    public final int XGetInputFocus(long param_0, CLongPointer param_1, Int32Pointer param_2) {
        long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
        long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XGetInputFocus(param_0, tmp_0, tmp_1);
        if (param_1 != null) {
            param_1.unlock();
        }
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XGetInputFocus(long param_0, long param_1, long param_2);

    public final long XInternAtom(long param_0, String param_1, int param_2) {
        Int8Pointer _param_1 = null == param_1? null :  nb.createInt8Pointer(param_1, false);
        long tmp_0 = _param_1 == null ? 0 : _param_1.longLockPointer();
        long tmp_ret = XInternAtom(param_0, tmp_0, param_2);
        if (_param_1 != null) {
            _param_1.unlock();
            _param_1.free();
        }
        return tmp_ret;
    }
    public final long XInternAtom(long param_0, Int8Pointer param_1, int param_2) {
        long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
        long tmp_ret = XInternAtom(param_0, tmp_0, param_2);
        if (param_1 != null) {
            param_1.unlock();
        }
        return tmp_ret;
    }
    public final native long XInternAtom(long param_0, long param_1, int param_2);

    public final native int XSetClipOrigin(long param_0, long param_1, int param_2, int param_3);

    public final int XTestQueryExtension(long param_0, Int32Pointer param_1, Int32Pointer param_2, Int32Pointer param_3, Int32Pointer param_4) {
        long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
        long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_2 = param_3 == null ? 0 : param_3.longLockPointer();
        long tmp_3 = param_4 == null ? 0 : param_4.longLockPointer();
        int tmp_ret = XTestQueryExtension(param_0, tmp_0, tmp_1, tmp_2, tmp_3);
        if (param_1 != null) {
            param_1.unlock();
        }
        if (param_2 != null) {
            param_2.unlock();
        }
        if (param_3 != null) {
            param_3.unlock();
        }
        if (param_4 != null) {
            param_4.unlock();
        }
        return tmp_ret;
    }
    public final native int XTestQueryExtension(long param_0, long param_1, long param_2, long param_3, long param_4);

    public final native long XCreateSimpleWindow(long param_0, long param_1, int param_2, int param_3, int param_4, int param_5, int param_6, long param_7, long param_8);

    public final native int XUngrabServer(long param_0);

    public final native int XFillArc(long param_0, long param_1, long param_2, int param_3, int param_4, int param_5, int param_6, int param_7, int param_8);

    public final native long XScreenOfDisplay(long param_0, int param_1);

    public final native int XSetClipMask(long param_0, long param_1, long param_2);

    public final int XChangeGC(long param_0, long param_1, long param_2, X11.XGCValues param_3) {
        long tmp_0 = param_3 == null ? 0 : param_3.longLockPointer();
        int tmp_ret = XChangeGC(param_0, param_1, param_2, tmp_0);
        if (param_3 != null) {
            param_3.unlock();
        }
        return tmp_ret;
    }
    public final native int XChangeGC(long param_0, long param_1, long param_2, long param_3);

    public final long XCreateBitmapFromData(long param_0, long param_1, String param_2, int param_3, int param_4) {
        Int8Pointer _param_2 = null == param_2? null :  nb.createInt8Pointer(param_2, false);
        long tmp_0 = _param_2 == null ? 0 : _param_2.longLockPointer();
        long tmp_ret = XCreateBitmapFromData(param_0, param_1, tmp_0, param_3, param_4);
        if (_param_2 != null) {
            _param_2.unlock();
            _param_2.free();
        }
        return tmp_ret;
    }
    public final long XCreateBitmapFromData(long param_0, long param_1, Int8Pointer param_2, int param_3, int param_4) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        long tmp_ret = XCreateBitmapFromData(param_0, param_1, tmp_0, param_3, param_4);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native long XCreateBitmapFromData(long param_0, long param_1, long param_2, int param_3, int param_4);

    public final native int XDeleteProperty(long param_0, long param_1, long param_2);

    public final native long XGetWMHints(long param_0, long param_1);

    public final native int XSetSelectionOwner(long param_0, long param_1, long param_2, long param_3);

    public final int XDestroyImage(X11.XImage ximage) {
        long tmp_0 = ximage == null ? 0 : ximage.longLockPointer();
        int tmp_ret = XDestroyImage(tmp_0);
        if (ximage != null) {
            ximage.unlock();
        }
        return tmp_ret;
    }
    public final native int XDestroyImage(long ximage);

    public final native int XDrawArc(long param_0, long param_1, long param_2, int param_3, int param_4, int param_5, int param_6, int param_7, int param_8);

    public final native int XGrabPointer(long param_0, long param_1, int param_2, int param_3, int param_4, int param_5, long param_6, long param_7, long param_8);

    public final native int XDisplayHeight(long param_0, int param_1);

    public final int XQueryColor(long param_0, long param_1, X11.XColor param_2) {
        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
        int tmp_ret = XQueryColor(param_0, param_1, tmp_0);
        if (param_2 != null) {
            param_2.unlock();
        }
        return tmp_ret;
    }
    public final native int XQueryColor(long param_0, long param_1, long param_2);

    public final native int XRaiseWindow(long param_0, long param_1);

    public final native int XWithdrawWindow(long param_0, long param_1, int param_2);

}

